We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
env_clear
1 parent 365a358 commit 16145a9Copy full SHA for 16145a9
library/std/src/process/tests.rs
@@ -399,3 +399,12 @@ fn test_command_implements_send_sync() {
399
fn take_send_sync_type<T: Send + Sync>(_: T) {}
400
take_send_sync_type(Command::new(""))
401
}
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