rust/tests/run-pass/env.rs

11 lines
336 B
Rust
Raw Normal View History

2018-10-20 18:31:46 -05:00
//ignore-windows: env var emulation not implemented on Windows
//ignore-macos: env var emulation not implemented on macOS
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()));
}