]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/comm.rs
14b21a242bddd890f3054f4ebbefdcba7c7bc819
[rust.git] / src / test / run-pass / comm.rs
1 // -*- rust -*-
2
3 use std;
4 import comm;
5 import comm::chan;
6 import comm::send;
7 import comm::recv;
8 import task;
9
10 fn main() {
11     let p = comm::port();
12     let t = task::spawn(chan(p), child);
13     let y = recv(p);
14     #error("received");
15     log(error, y);
16     assert (y == 10);
17 }
18
19 fn child(c: chan<int>) {
20     #error("sending");
21     send(c, 10);
22     #error("value sent");
23 }