From e17193dc510b4a4e238db28c529289a1f4beccff Mon Sep 17 00:00:00 2001 From: Timo Freiberg Date: Sun, 10 May 2020 15:56:51 +0200 Subject: [PATCH] Expand fixture documentation a little --- crates/ra_db/src/fixture.rs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 51d4c493e3..f8f7670919 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs @@ -2,7 +2,7 @@ //! A fixture without metadata is parsed into a single source file. //! Use this to test functionality local to one file. //! -//! Example: +//! Simple Example: //! ``` //! r#" //! fn main() { @@ -15,7 +15,7 @@ //! The basic form is specifying filenames, //! which is also how to define multiple files in a single test fixture //! -//! Example: +//! Example using two files in the same crate: //! ``` //! " //! //- /main.rs @@ -29,6 +29,20 @@ //! " //! ``` //! +//! Example using two crates with one file each, with one crate depending on the other: +//! ``` +//! r#" +//! //- /main.rs crate:a deps:b +//! fn main() { +//! b::foo(); +//! } +//! //- /lib.rs crate:b +//! pub fn b() { +//! println!("Hello World") +//! } +//! "# +//! ``` +//! //! Metadata allows specifying all settings and variables //! that are available in a real rust project: //! - crate names via `crate:cratename` @@ -36,7 +50,7 @@ //! - configuration settings via `cfg:dbg=false,opt_level=2` //! - environment variables via `env:PATH=/bin,RUST_LOG=debug` //! -//! Example: +//! Example using all available metadata: //! ``` //! " //! //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo