Add a run-pass test for linked failure
This commit is contained in:
parent
103197bc42
commit
69eda46af8
1 changed files with 24 additions and 0 deletions
24
src/test/run-pass/linked-failure.rs
Normal file
24
src/test/run-pass/linked-failure.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
// -*- rust -*-
|
||||
|
||||
// error-pattern:1 == 2
|
||||
use std;
|
||||
import std::task;
|
||||
import std::comm::port;
|
||||
import std::comm::recv;
|
||||
|
||||
fn child() { assert (1 == 2); }
|
||||
|
||||
fn parent() {
|
||||
// Since this task isn't supervised it won't bring down the whole
|
||||
// process
|
||||
task::unsupervise();
|
||||
let p = port::<int>();
|
||||
let f = child;
|
||||
task::spawn(f);
|
||||
let x = recv(p);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let f = parent;
|
||||
task::spawn(f);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue