about summary refs log tree commit diff
path: root/src/test/stdtest/comm.rs
blob: 706cca7ddafc6d71bcc1790c0886d0632e299df9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std;
import std::comm;

#[test]
fn create_port_and_chan() {
    let p = comm::mk_port[int]();
    let c = p.mk_chan();
}

#[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);
}