]> git.proxmox.com Git - rustc.git/blobdiff - library/std/src/process/tests.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / library / std / src / process / tests.rs
index 05e093434be1bf57f306e34bdbd96b5a76bad9df..bc71c150550a4080a0ad6f51e945a7cef6698460 100644 (file)
@@ -399,3 +399,12 @@ fn test_command_implements_send_sync() {
     fn take_send_sync_type<T: Send + Sync>(_: T) {}
     take_send_sync_type(Command::new(""))
 }
+
+// Ensure that starting a process with no environment variables works on Windows.
+// This will fail if the environment block is ill-formed.
+#[test]
+#[cfg(windows)]
+fn env_empty() {
+    let p = Command::new("cmd").args(&["/C", "exit 0"]).env_clear().spawn();
+    assert!(p.is_ok());
+}