mirror of
https://gitee.com/openharmony/third_party_rust_nix
synced 2024-12-12 09:56:39 +00:00
10 lines
232 B
Rust
10 lines
232 B
Rust
use std::env;
|
|
|
|
#[test]
|
|
fn clearenv() {
|
|
env::set_var("FOO", "BAR");
|
|
unsafe { nix::env::clearenv() }.unwrap();
|
|
assert_eq!(env::var("FOO").unwrap_err(), env::VarError::NotPresent);
|
|
assert_eq!(env::vars().count(), 0);
|
|
}
|