Skip to content

Commit dd162d7

Browse files
committed
test_inherit_env: Don't look for hidden environment variables on Windows
Fixes #29972.
1 parent e24fffe commit dd162d7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libstd/process.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,10 @@ mod tests {
803803
let output = String::from_utf8(result.stdout).unwrap();
804804

805805
for (ref k, ref v) in env::vars() {
806-
// don't check windows magical empty-named variables
807-
assert!(k.is_empty() ||
806+
// Windows has hidden environment variables whose names start with
807+
// equals signs (`=`). Those do not show up in the output of the
808+
// `set` command.
809+
assert!((cfg!(windows) && k.starts_with("=")) ||
808810
output.contains(&format!("{}={}", *k, *v)),
809811
"output doesn't contain `{}={}`\n{}",
810812
k, v, output);

0 commit comments

Comments
 (0)