1
Fork 0

Add task::send and task::recv

This commit is contained in:
Brian Anderson 2011-07-23 22:41:28 -07:00
parent 73fed01108
commit bd81adabff
2 changed files with 16 additions and 0 deletions

View file

@ -33,6 +33,14 @@ fn test_join() {
assert task::join(failtask) == task::tr_failure;
}
#[test]
fn test_send_recv() {
auto p = port[int]();
auto c = chan(p);
task::send(c, 10);
assert task::recv(p) == 10;
}
#[test]
fn test_worker() {
task::worker(fn(port[int] p) {