Skip to content

Commit 8ac15c6

Browse files
committed
Added test cases.
1 parent d584de7 commit 8ac15c6

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

src/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ TASK_XFAILS := test/run-pass/acyclic-unwind.rs \
381381
test/run-pass/task-comm-7.rs \
382382
test/run-pass/task-comm-8.rs \
383383
test/run-pass/task-comm-9.rs \
384+
test/run-pass/task-comm-10.rs \
385+
test/run-pass/task-comm-11.rs \
386+
test/run-pass/task-life-0.rs \
384387
test/run-pass/task-comm.rs \
385388
test/run-pass/threads.rs \
386389
test/run-pass/yield.rs

src/test/run-pass/task-comm-10.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
io fn start(chan[chan[str]] c) {
2+
let port[str] p = port();
3+
c <| chan(p);
4+
auto a <- p;
5+
auto b <- p;
6+
// Never read the second string.
7+
}
8+
9+
io fn main() {
10+
let port[chan[str]] p = port();
11+
auto child = spawn "start" start(chan(p));
12+
auto c <- p;
13+
c <| "A";
14+
c <| "B";
15+
yield;
16+
}

src/test/run-pass/task-comm-11.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
io fn start(chan[chan[str]] c) {
2+
let port[str] p = port();
3+
c <| chan(p);
4+
}
5+
6+
io fn main() {
7+
let port[chan[str]] p = port();
8+
auto child = spawn "child" start(chan(p));
9+
auto c <- p;
10+
}

src/test/run-pass/task-life-0.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn main() -> () {
2+
spawn child("Hello");
3+
}
4+
5+
fn child(str s) {
6+
7+
}

0 commit comments

Comments
 (0)