2011-08-15 18:54:02 -05:00
|
|
|
// -*- rust -*-
|
2011-03-24 19:50:05 -05:00
|
|
|
|
2012-09-11 19:46:20 -05:00
|
|
|
extern mod std;
|
2012-09-05 14:32:05 -05:00
|
|
|
use comm::Port;
|
|
|
|
use comm::Chan;
|
|
|
|
use comm::send;
|
|
|
|
use comm::recv;
|
2011-03-24 19:50:05 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
fn main() {
|
2012-08-27 16:22:25 -05:00
|
|
|
let po = Port();
|
|
|
|
let ch = Chan(po);
|
2011-08-15 18:54:02 -05:00
|
|
|
send(ch, 10);
|
2011-08-25 13:20:43 -05:00
|
|
|
let i = recv(po);
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (i == 10);
|
2011-08-15 18:54:02 -05:00
|
|
|
send(ch, 11);
|
2011-08-25 13:20:43 -05:00
|
|
|
let j = recv(po);
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (j == 11);
|
2011-08-10 11:27:22 -05:00
|
|
|
}
|