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

19 lines
280 B
Rust
Raw Normal View History

// -*- rust -*-
extern mod std;
2012-09-05 14:32:05 -05:00
use comm::Port;
use comm::Chan;
use comm::send;
use comm::recv;
fn main() {
2012-08-27 16:22:25 -05:00
let po = Port();
let ch = Chan(po);
send(ch, 10);
let i = recv(po);
assert (i == 10);
send(ch, 11);
let j = recv(po);
assert (j == 11);
}