Skip to content

Commit 16145a9

Browse files
committed
Test that env_clear works on Windows
1 parent 365a358 commit 16145a9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

library/std/src/process/tests.rs

+9
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,12 @@ fn test_command_implements_send_sync() {
399399
fn take_send_sync_type<T: Send + Sync>(_: T) {}
400400
take_send_sync_type(Command::new(""))
401401
}
402+
403+
// Ensure that starting a process with no environment variables works on Windows.
404+
// This will fail if the environment block is ill-formed.
405+
#[test]
406+
#[cfg(windows)]
407+
fn env_empty() {
408+
let p = Command::new("cmd").args(&["/C", "exit 0"]).env_clear().spawn();
409+
assert!(p.is_ok());
410+
}

0 commit comments

Comments
 (0)