From 8ac15c684481ea5b60f85c3f57b63e89a261e7dd Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Wed, 11 Aug 2010 15:05:33 -0700 Subject: [PATCH] Added test cases. --- src/Makefile | 3 +++ src/test/run-pass/task-comm-10.rs | 16 ++++++++++++++++ src/test/run-pass/task-comm-11.rs | 10 ++++++++++ src/test/run-pass/task-life-0.rs | 7 +++++++ 4 files changed, 36 insertions(+) create mode 100644 src/test/run-pass/task-comm-10.rs create mode 100644 src/test/run-pass/task-comm-11.rs create mode 100644 src/test/run-pass/task-life-0.rs diff --git a/src/Makefile b/src/Makefile index 2e8deb7b3f5..63834799bfd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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 diff --git a/src/test/run-pass/task-comm-10.rs b/src/test/run-pass/task-comm-10.rs new file mode 100644 index 00000000000..529ef6f51d8 --- /dev/null +++ b/src/test/run-pass/task-comm-10.rs @@ -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; +} \ No newline at end of file diff --git a/src/test/run-pass/task-comm-11.rs b/src/test/run-pass/task-comm-11.rs new file mode 100644 index 00000000000..519eb699f8e --- /dev/null +++ b/src/test/run-pass/task-comm-11.rs @@ -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; +} \ No newline at end of file diff --git a/src/test/run-pass/task-life-0.rs b/src/test/run-pass/task-life-0.rs new file mode 100644 index 00000000000..f15792fbcf7 --- /dev/null +++ b/src/test/run-pass/task-life-0.rs @@ -0,0 +1,7 @@ +fn main() -> () { + spawn child("Hello"); +} + +fn child(str s) { + +} \ No newline at end of file