rust/src/test/run-pass/decl-with-recv.rs
2012-09-05 12:32:05 -07:00

19 lines
273 B
Rust

// -*- rust -*-
use std;
use comm::Port;
use comm::Chan;
use comm::send;
use comm::recv;
fn main() {
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);
}