aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-08-03 12:20:29 -0700
committerGraydon Hoare <[email protected]>2010-08-03 12:20:29 -0700
commit1fc4e9fcc623df313dcaaf541f08fc7a8415c67f (patch)
tree6caa66a2e864bdd48be6fb8e199a0c44e146ef4e /src/test
parentUse a better heuristic to determine whether we're on a Mac, issue 69 (diff)
downloadrust-1fc4e9fcc623df313dcaaf541f08fc7a8415c67f.tar.xz
rust-1fc4e9fcc623df313dcaaf541f08fc7a8415c67f.zip
Add tests and fix pexp bug. Closes #141.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/child-outlives-parent.rs8
-rw-r--r--src/test/run-pass/constrained-type.rs14
2 files changed, 22 insertions, 0 deletions
diff --git a/src/test/run-pass/child-outlives-parent.rs b/src/test/run-pass/child-outlives-parent.rs
new file mode 100644
index 00000000..d7d7c344
--- /dev/null
+++ b/src/test/run-pass/child-outlives-parent.rs
@@ -0,0 +1,8 @@
+// Reported as issue #126, child leaks the string.
+
+fn child2(str s) {
+}
+
+fn main() {
+ auto x = spawn child2("hi");
+} \ No newline at end of file
diff --git a/src/test/run-pass/constrained-type.rs b/src/test/run-pass/constrained-type.rs
new file mode 100644
index 00000000..88a39ec8
--- /dev/null
+++ b/src/test/run-pass/constrained-type.rs
@@ -0,0 +1,14 @@
+// -*- rust -*-
+
+// Reported as issue #141, as a parse error. Ought to work in full though.
+
+type list = tag(cons(int,@list), nil());
+type bubu = rec(int x, int y);
+
+
+fn less_than(int x, int y) -> bool { ret x < y; }
+
+type ordered_range = rec(int low, int high) : less_than(*.low, *.high);
+
+fn main() {
+}