move comm functions out of rust abi
This commit is contained in:
parent
44697a4293
commit
d9b23cb022
3 changed files with 34 additions and 14 deletions
|
|
@ -4,6 +4,13 @@ import std::comm;
|
|||
#[test]
|
||||
fn create_port_and_chan() { let p = comm::port::<int>(); comm::chan(p); }
|
||||
|
||||
#[test]
|
||||
fn send_int() {
|
||||
let p = comm::port::<int>();
|
||||
let c = comm::chan(p);
|
||||
comm::send(c, 22);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn send_recv_fn() {
|
||||
let p = comm::port::<int>();
|
||||
|
|
@ -21,9 +28,17 @@ fn send_recv_fn_infer() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn chan_chan() {
|
||||
fn chan_chan_infer() {
|
||||
let p = comm::port(), p2 = comm::port::<int>();
|
||||
let c = comm::chan(p);
|
||||
comm::send(c, comm::chan(p2));
|
||||
comm::recv(p);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn chan_chan() {
|
||||
let p = comm::port::<comm::chan<int>>(), p2 = comm::port::<int>();
|
||||
let c = comm::chan(p);
|
||||
comm::send(c, comm::chan(p2));
|
||||
comm::recv(p);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue