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;
|
2011-08-25 13:20:43 -05:00
|
|
|
import std::comm::port;
|
|
|
|
import std::comm::chan;
|
2011-08-15 18:54:02 -05:00
|
|
|
import std::comm::send;
|
2011-08-25 13:20:43 -05:00
|
|
|
import std::comm::recv;
|
2011-03-24 19:50:05 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
fn main() {
|
2011-08-25 13:20:43 -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
|
|
|
}
|