rust/src/test/run-pass/decl-with-recv.rs

16 lines
223 B
Rust
Raw Normal View History

// -*- rust -*-
fn main() {
2011-07-27 07:19:39 -05:00
let po: port[int] = port();
let ch: chan[int] = chan(po);
ch <| 10;
2011-07-27 07:19:39 -05:00
let i: int;
po |> i;
assert (i == 10);
ch <| 11;
2011-07-27 07:19:39 -05:00
let j;
po |> j;
assert (j == 11);
}