From dd162d77d4aaa90a841157312b8215fb24727337 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Sun, 22 Nov 2015 11:12:18 +0000 Subject: [PATCH] test_inherit_env: Don't look for hidden environment variables on Windows Fixes #29972. --- src/libstd/process.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index d26641dbfcf82..083205e824d59 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);