2011-08-15 18:54:02 -05:00
|
|
|
// -*- rust -*-
|
2011-03-24 19:50:05 -05:00
|
|
|
|
2011-08-15 18:54:02 -05:00
|
|
|
use std;
|
|
|
|
import std::comm::mk_port;
|
|
|
|
import std::comm::send;
|
2011-03-24 19:50:05 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
fn main() {
|
2011-08-15 18:54:02 -05:00
|
|
|
let po = mk_port();
|
|
|
|
let ch = po.mk_chan();
|
|
|
|
send(ch, 10);
|
|
|
|
let i = po.recv();
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (i == 10);
|
2011-08-15 18:54:02 -05:00
|
|
|
send(ch, 11);
|
|
|
|
let j = po.recv();
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (j == 11);
|
2011-08-10 11:27:22 -05:00
|
|
|
}
|