mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Expand fixture documentation a little
This commit is contained in:
parent
66db88d226
commit
e17193dc51
1 changed files with 17 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
//! A fixture without metadata is parsed into a single source file.
|
//! A fixture without metadata is parsed into a single source file.
|
||||||
//! Use this to test functionality local to one file.
|
//! Use this to test functionality local to one file.
|
||||||
//!
|
//!
|
||||||
//! Example:
|
//! Simple Example:
|
||||||
//! ```
|
//! ```
|
||||||
//! r#"
|
//! r#"
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
//! The basic form is specifying filenames,
|
//! The basic form is specifying filenames,
|
||||||
//! which is also how to define multiple files in a single test fixture
|
//! which is also how to define multiple files in a single test fixture
|
||||||
//!
|
//!
|
||||||
//! Example:
|
//! Example using two files in the same crate:
|
||||||
//! ```
|
//! ```
|
||||||
//! "
|
//! "
|
||||||
//! //- /main.rs
|
//! //- /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
|
//! Metadata allows specifying all settings and variables
|
||||||
//! that are available in a real rust project:
|
//! that are available in a real rust project:
|
||||||
//! - crate names via `crate:cratename`
|
//! - crate names via `crate:cratename`
|
||||||
|
@ -36,7 +50,7 @@
|
||||||
//! - configuration settings via `cfg:dbg=false,opt_level=2`
|
//! - configuration settings via `cfg:dbg=false,opt_level=2`
|
||||||
//! - environment variables via `env:PATH=/bin,RUST_LOG=debug`
|
//! - 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
|
//! //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo
|
||||||
|
|
Loading…
Reference in a new issue