2011-08-15 16:54:02 -07:00
|
|
|
// -*- rust -*-
|
2011-03-24 20:50:05 -04:00
|
|
|
|
2011-08-15 16:54:02 -07:00
|
|
|
use std;
|
2011-12-13 16:25:51 -08:00
|
|
|
import comm::port;
|
|
|
|
import comm::chan;
|
|
|
|
import comm::send;
|
|
|
|
import comm::recv;
|
2011-03-24 20:50:05 -04:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
fn main() {
|
2011-08-25 11:20:43 -07:00
|
|
|
let po = port();
|
|
|
|
let ch = chan(po);
|
2011-08-15 16:54:02 -07:00
|
|
|
send(ch, 10);
|
2011-08-25 11:20:43 -07:00
|
|
|
let i = recv(po);
|
2011-06-15 11:19:50 -07:00
|
|
|
assert (i == 10);
|
2011-08-15 16:54:02 -07:00
|
|
|
send(ch, 11);
|
2011-08-25 11:20:43 -07:00
|
|
|
let j = recv(po);
|
2011-06-15 11:19:50 -07:00
|
|
|
assert (j == 11);
|
2011-08-10 09:27:22 -07:00
|
|
|
}
|