Added test cases.

This commit is contained in:
Michael Bebenita 2010-08-11 15:05:33 -07:00
parent d584de7a37
commit 8ac15c6844
4 changed files with 36 additions and 0 deletions

View file

@ -381,6 +381,9 @@ TASK_XFAILS := test/run-pass/acyclic-unwind.rs \
test/run-pass/task-comm-7.rs \ test/run-pass/task-comm-7.rs \
test/run-pass/task-comm-8.rs \ test/run-pass/task-comm-8.rs \
test/run-pass/task-comm-9.rs \ test/run-pass/task-comm-9.rs \
test/run-pass/task-comm-10.rs \
test/run-pass/task-comm-11.rs \
test/run-pass/task-life-0.rs \
test/run-pass/task-comm.rs \ test/run-pass/task-comm.rs \
test/run-pass/threads.rs \ test/run-pass/threads.rs \
test/run-pass/yield.rs test/run-pass/yield.rs

View file

@ -0,0 +1,16 @@
io fn start(chan[chan[str]] c) {
let port[str] p = port();
c <| chan(p);
auto a <- p;
auto b <- p;
// Never read the second string.
}
io fn main() {
let port[chan[str]] p = port();
auto child = spawn "start" start(chan(p));
auto c <- p;
c <| "A";
c <| "B";
yield;
}

View file

@ -0,0 +1,10 @@
io fn start(chan[chan[str]] c) {
let port[str] p = port();
c <| chan(p);
}
io fn main() {
let port[chan[str]] p = port();
auto child = spawn "child" start(chan(p));
auto c <- p;
}

View file

@ -0,0 +1,7 @@
fn main() -> () {
spawn child("Hello");
}
fn child(str s) {
}