Added test cases.
This commit is contained in:
parent
d584de7a37
commit
8ac15c6844
4 changed files with 36 additions and 0 deletions
|
@ -381,6 +381,9 @@ TASK_XFAILS := test/run-pass/acyclic-unwind.rs \
|
|||
test/run-pass/task-comm-7.rs \
|
||||
test/run-pass/task-comm-8.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/threads.rs \
|
||||
test/run-pass/yield.rs
|
||||
|
|
16
src/test/run-pass/task-comm-10.rs
Normal file
16
src/test/run-pass/task-comm-10.rs
Normal 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;
|
||||
}
|
10
src/test/run-pass/task-comm-11.rs
Normal file
10
src/test/run-pass/task-comm-11.rs
Normal 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;
|
||||
}
|
7
src/test/run-pass/task-life-0.rs
Normal file
7
src/test/run-pass/task-life-0.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
fn main() -> () {
|
||||
spawn child("Hello");
|
||||
}
|
||||
|
||||
fn child(str s) {
|
||||
|
||||
}
|
Loading…
Reference in a new issue