rust/src/test/run-fail/task-spawn-barefn.rs

18 lines
429 B
Rust
Raw Normal View History

// error-pattern:Ensure that the child thread runs by panicking
// ignore-emscripten Needs threads.
2015-02-17 23:10:25 +00:00
use std::thread;
fn main() {
// the purpose of this test is to make sure that thread::spawn()
// works when provided with a bare function:
2015-02-17 23:10:25 +00:00
let r = thread::spawn(startfn).join();
if r.is_err() {
panic!()
}
}
fn startfn() {
assert!("Ensure that the child thread runs by panicking".is_empty());
}