Skip to content

Commit

Permalink
Fix testenv var state test
Browse files Browse the repository at this point in the history
  • Loading branch information
sonro committed Aug 1, 2024
1 parent 4dfeed7 commit ebc2f6c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test_util/src/tests/testenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ mod init {
#[test]
fn vars_state() {
let testenv = TestEnv::init();
let existing_vars: HashMap<String, String> = std::env::vars().collect();
dbg!("existing vars: {:?}", &existing_vars);
let mut vars: HashMap<String, String> = HashMap::new();
test_in_env(&testenv, || {
for (key, value) in &existing_vars {
assert_env_var(key, value);
for (k, v) in std::env::vars() {
vars.insert(k, v);
}
});
for (k, v) in &vars {
assert_env_var(k.as_str(), v.as_str());
}
}

#[test]
Expand Down

0 comments on commit ebc2f6c

Please sign in to comment.