rust/src/test/run-fail/task-comm-recv-block.rs
2012-01-06 22:40:32 -08:00

20 lines
343 B
Rust

// error-pattern:goodfail
use std;
import task;
import comm;
fn goodfail() {
task::yield();
fail "goodfail";
}
fn main() {
task::spawn {|| goodfail(); };
let po = comm::port();
// We shouldn't be able to get past this recv since there's no
// message available
let i: int = comm::recv(po);
fail "badfail";
}