fix #10450
This commit is contained in:
parent
88831383b4
commit
c45870b85e
@ -22,13 +22,23 @@ use std::io;
|
||||
|
||||
#[test]
|
||||
fn test_destroy_once() {
|
||||
let mut p = run::Process::new("echo", [], run::ProcessOptions::new());
|
||||
#[cfg(not(target_os="android"))]
|
||||
static PROG: &'static str = "echo";
|
||||
#[cfg(target_os="android")]
|
||||
static PROG: &'static str = "ls"; // android don't have echo binary
|
||||
|
||||
let mut p = run::Process::new(PROG, [], run::ProcessOptions::new());
|
||||
p.destroy(); // this shouldn't crash (and nor should the destructor)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_destroy_twice() {
|
||||
let mut p = run::Process::new("echo", [], run::ProcessOptions::new());
|
||||
#[cfg(not(target_os="android"))]
|
||||
static PROG: &'static str = "echo";
|
||||
#[cfg(target_os="android")]
|
||||
static PROG: &'static str = "ls"; // android don't have echo binary
|
||||
|
||||
let mut p = run::Process::new(PROG, [], run::ProcessOptions::new());
|
||||
p.destroy(); // this shouldnt crash...
|
||||
do io::io_error::cond.trap(|_| {}).inside {
|
||||
p.destroy(); // ...and nor should this (and nor should the destructor)
|
||||
|
Loading…
Reference in New Issue
Block a user