summaryrefslogtreecommitdiff
path: root/test/test_clearenv.rs
blob: f122f7c67f95c5fb3c43264178b2520619875633 (plain)
1
2
3
4
5
6
7
8
9
10
11
extern crate nix;

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);
}