diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2015-11-22 11:12:18 +0000 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2015-11-22 11:12:49 +0000 |
| commit | dd162d77d4aaa90a841157312b8215fb24727337 (patch) | |
| tree | 95ec10bf7b9b5c0cca406ad2fb4e1d27ddfb9680 /src/libstd/process.rs | |
| parent | e24fffef8a560ddf968a866db8da96bc461f4038 (diff) | |
| download | rust-dd162d77d4aaa90a841157312b8215fb24727337.tar.gz rust-dd162d77d4aaa90a841157312b8215fb24727337.zip | |
test_inherit_env: Don't look for hidden environment variables on Windows
Fixes #29972.
Diffstat (limited to 'src/libstd/process.rs')
| -rw-r--r-- | src/libstd/process.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs index d26641dbfcf..083205e824d 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -803,8 +803,10 @@ mod tests { let output = String::from_utf8(result.stdout).unwrap(); for (ref k, ref v) in env::vars() { - // don't check windows magical empty-named variables - assert!(k.is_empty() || + // Windows has hidden environment variables whose names start with + // equals signs (`=`). Those do not show up in the output of the + // `set` command. + assert!((cfg!(windows) && k.starts_with("=")) || output.contains(&format!("{}={}", *k, *v)), "output doesn't contain `{}={}`\n{}", k, v, output); |
