aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-03-21 21:30:32 -0400
committerGraydon Hoare <[email protected]>2011-03-22 08:04:47 -0700
commit3dcb79dac91f0a53fecbf1c5340db6c54c5a2e71 (patch)
tree2724baa5c16c810a84f4d12f17ff84c4f830f0e9 /src/test
parentGeneralize send/recv to work for more types (diff)
downloadrust-3dcb79dac91f0a53fecbf1c5340db6c54c5a2e71.tar.xz
rust-3dcb79dac91f0a53fecbf1c5340db6c54c5a2e71.zip
Add a regression test for channels of nil, which happens to work in rustc, but not in rustboot
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/task-comm-chan-nil.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/task-comm-chan-nil.rs b/src/test/run-pass/task-comm-chan-nil.rs
new file mode 100644
index 00000000..c8f5a90f
--- /dev/null
+++ b/src/test/run-pass/task-comm-chan-nil.rs
@@ -0,0 +1,17 @@
+// -*- rust -*-
+
+// rustboot can't transmit nils across channels because they don't have
+// any size, but rustc currently can because they do have size. Whether
+// or not this is desirable I don't know, but here's a regression test.
+
+impure fn main() {
+ let port[()] po = port();
+ let chan[()] ch = chan(po);
+
+ ch <| ();
+
+ let () n;
+ n <- po;
+
+ check (n == ());
+}