2011-07-29 19:53:02 -05:00
|
|
|
use std;
|
|
|
|
import std::comm;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn create_port_and_chan() {
|
|
|
|
let p = comm::mk_port[int]();
|
2011-07-29 20:52:16 -05:00
|
|
|
let c = p.mk_chan();
|
2011-07-29 19:53:02 -05:00
|
|
|
}
|
2011-08-01 16:57:17 -05:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn send_recv() {
|
|
|
|
let p = comm::mk_port();
|
|
|
|
let c = p.mk_chan();
|
|
|
|
|
|
|
|
c.send(42);
|
|
|
|
let v = 0;
|
|
|
|
p.recv_into(v);
|
|
|
|
|
|
|
|
assert(42 == v);
|
|
|
|
}
|