Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tidy: Re-enable check for inline unit tests
- Loading branch information
1 parent
3f2088a
commit ec09616
Showing
3 changed files
with
30 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use super::UnstableFeatures; | ||
|
||
#[test] | ||
fn rustc_bootstrap_parsing() { | ||
let is_bootstrap = |env, krate| { | ||
std::env::set_var("RUSTC_BOOTSTRAP", env); | ||
matches!(UnstableFeatures::from_environment(krate), UnstableFeatures::Cheat) | ||
}; | ||
assert!(is_bootstrap("1", None)); | ||
assert!(is_bootstrap("1", Some("x"))); | ||
// RUSTC_BOOTSTRAP allows specifying a specific crate | ||
assert!(is_bootstrap("x", Some("x"))); | ||
// RUSTC_BOOTSTRAP allows multiple comma-delimited crates | ||
assert!(is_bootstrap("x,y,z", Some("x"))); | ||
assert!(is_bootstrap("x,y,z", Some("y"))); | ||
// Crate that aren't specified do not get unstable features | ||
assert!(!is_bootstrap("x", Some("a"))); | ||
assert!(!is_bootstrap("x,y,z", Some("a"))); | ||
assert!(!is_bootstrap("x,y,z", None)); | ||
|
||
// this is technically a breaking change, but there are no stability guarantees for RUSTC_BOOTSTRAP | ||
assert!(!is_bootstrap("0", None)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters