2019-04-21 06:43:53 -05:00
|
|
|
//ignore-windows: TODO env var emulation stubbed out on Windows
|
2018-10-20 18:31:46 -05:00
|
|
|
|
2018-10-16 05:44:04 -05:00
|
|
|
use std::env;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(env::var("MIRI_TEST"), Err(env::VarError::NotPresent));
|
|
|
|
env::set_var("MIRI_TEST", "the answer");
|
|
|
|
assert_eq!(env::var("MIRI_TEST"), Ok("the answer".to_owned()));
|
2019-08-13 16:17:53 -05:00
|
|
|
// Test that miri environment is isolated when communication is disabled.
|
|
|
|
assert!(env::var("MIRI_ENV_VAR_TEST").is_err());
|
2020-03-05 08:41:35 -06:00
|
|
|
// Test that the new variable is in the `std::env::Vars` iterator
|
|
|
|
assert!(env::vars().any(|(name, value)| name == "MIRI_TEST"))
|
2018-10-16 05:44:04 -05:00
|
|
|
}
|