rust/src/test/run-pass/comm.rs
2011-07-27 15:54:33 +02:00

14 lines
283 B
Rust

// xfail-stage0
// -*- rust -*-
fn main() {
let p: port[int] = port();
let t: task = spawn child(chan(p));
let y: int;
p |> y;
log_err "received";
log_err y;
assert (y == 10);
}
fn child(c: chan[int]) { log_err "sending"; c <| 10; log_err "value sent" }