2011-07-29 17:53:02 -07:00
|
|
|
use std;
|
|
|
|
import std::comm;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn create_port_and_chan() {
|
|
|
|
let p = comm::mk_port[int]();
|
2011-07-29 18:52:16 -07:00
|
|
|
let c = p.mk_chan();
|
2011-07-29 17:53:02 -07:00
|
|
|
}
|
2011-08-01 14:57:17 -07:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn send_recv() {
|
|
|
|
let p = comm::mk_port();
|
|
|
|
let c = p.mk_chan();
|
|
|
|
|
|
|
|
c.send(42);
|
2011-08-02 12:29:10 -07:00
|
|
|
let v = p.recv();
|
|
|
|
log_err v;
|
2011-08-01 14:57:17 -07:00
|
|
|
assert(42 == v);
|
2011-08-02 12:29:10 -07:00
|
|
|
}
|