From 1fc4e9fcc623df313dcaaf541f08fc7a8415c67f Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 3 Aug 2010 12:20:29 -0700 Subject: Add tests and fix pexp bug. Closes #141. --- src/test/run-pass/child-outlives-parent.rs | 8 ++++++++ src/test/run-pass/constrained-type.rs | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/test/run-pass/child-outlives-parent.rs create mode 100644 src/test/run-pass/constrained-type.rs (limited to 'src/test') 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() { +} -- cgit v1.2.3