]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/core-run-destroy.rs
Revert "auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, r=brson"
[rust.git] / src / test / run-pass / core-run-destroy.rs
index 90e63fc977d866841394f491be862265b95ef0c2..2551d1a5cfcba32455e421de89a3cae23a37c9b8 100644 (file)
 
 #[test]
 fn test_destroy_once() {
-    let p = run::Process::new("echo", [], run::ProcessOptions::new());
-    let mut p = p.unwrap();
+    let mut p = run::Process::new("echo", [], run::ProcessOptions::new());
     p.destroy(); // this shouldn't crash (and nor should the destructor)
 }
 
 #[test]
 fn test_destroy_twice() {
-    let p = run::Process::new("echo", [], run::ProcessOptions::new());
-    let mut p = p.unwrap();
+    let mut p = run::Process::new("echo", [], run::ProcessOptions::new());
     p.destroy(); // this shouldnt crash...
     p.destroy(); // ...and nor should this (and nor should the destructor)
 }
@@ -76,8 +74,7 @@ fn process_exists(pid: libc::pid_t) -> bool {
     }
 
     // this process will stay alive indefinitely trying to read from stdin
-    let p = run::Process::new(BLOCK_COMMAND, [], run::ProcessOptions::new());
-    let mut p = p.unwrap();
+    let mut p = run::Process::new(BLOCK_COMMAND, [], run::ProcessOptions::new());
 
     assert!(process_exists(p.get_id()));