rust/src/test/run-pass/decl-with-recv.rs
2011-08-16 15:05:56 -07:00

17 lines
269 B
Rust

// -*- rust -*-
use std;
import std::comm::mk_port;
import std::comm::send;
fn main() {
let po = mk_port();
let ch = po.mk_chan();
send(ch, 10);
let i = po.recv();
assert (i == 10);
send(ch, 11);
let j = po.recv();
assert (j == 11);
}