diff options
author | Timo Freiberg <[email protected]> | 2020-05-10 14:56:51 +0100 |
---|---|---|
committer | Timo Freiberg <[email protected]> | 2020-05-10 15:51:12 +0100 |
commit | e17193dc510b4a4e238db28c529289a1f4beccff (patch) | |
tree | 9d6eddb0fddb6c472e181ea9e0f1b1eda8f710f0 /crates | |
parent | 66db88d226704a75a2fa38782ee3b82fd7829d5e (diff) |
Expand fixture documentation a little
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_db/src/fixture.rs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 51d4c493e..f8f767091 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | //! A fixture without metadata is parsed into a single source file. | 2 | //! A fixture without metadata is parsed into a single source file. |
3 | //! Use this to test functionality local to one file. | 3 | //! Use this to test functionality local to one file. |
4 | //! | 4 | //! |
5 | //! Example: | 5 | //! Simple Example: |
6 | //! ``` | 6 | //! ``` |
7 | //! r#" | 7 | //! r#" |
8 | //! fn main() { | 8 | //! fn main() { |
@@ -15,7 +15,7 @@ | |||
15 | //! The basic form is specifying filenames, | 15 | //! The basic form is specifying filenames, |
16 | //! which is also how to define multiple files in a single test fixture | 16 | //! which is also how to define multiple files in a single test fixture |
17 | //! | 17 | //! |
18 | //! Example: | 18 | //! Example using two files in the same crate: |
19 | //! ``` | 19 | //! ``` |
20 | //! " | 20 | //! " |
21 | //! //- /main.rs | 21 | //! //- /main.rs |
@@ -29,6 +29,20 @@ | |||
29 | //! " | 29 | //! " |
30 | //! ``` | 30 | //! ``` |
31 | //! | 31 | //! |
32 | //! Example using two crates with one file each, with one crate depending on the other: | ||
33 | //! ``` | ||
34 | //! r#" | ||
35 | //! //- /main.rs crate:a deps:b | ||
36 | //! fn main() { | ||
37 | //! b::foo(); | ||
38 | //! } | ||
39 | //! //- /lib.rs crate:b | ||
40 | //! pub fn b() { | ||
41 | //! println!("Hello World") | ||
42 | //! } | ||
43 | //! "# | ||
44 | //! ``` | ||
45 | //! | ||
32 | //! Metadata allows specifying all settings and variables | 46 | //! Metadata allows specifying all settings and variables |
33 | //! that are available in a real rust project: | 47 | //! that are available in a real rust project: |
34 | //! - crate names via `crate:cratename` | 48 | //! - crate names via `crate:cratename` |
@@ -36,7 +50,7 @@ | |||
36 | //! - configuration settings via `cfg:dbg=false,opt_level=2` | 50 | //! - configuration settings via `cfg:dbg=false,opt_level=2` |
37 | //! - environment variables via `env:PATH=/bin,RUST_LOG=debug` | 51 | //! - environment variables via `env:PATH=/bin,RUST_LOG=debug` |
38 | //! | 52 | //! |
39 | //! Example: | 53 | //! Example using all available metadata: |
40 | //! ``` | 54 | //! ``` |
41 | //! " | 55 | //! " |
42 | //! //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo | 56 | //! //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo |