aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/bad-alt.rs6
-rw-r--r--src/test/run-pass/alt-type-simple.rs11
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/compile-fail/bad-alt.rs b/src/test/compile-fail/bad-alt.rs
new file mode 100644
index 00000000..f2582879
--- /dev/null
+++ b/src/test/compile-fail/bad-alt.rs
@@ -0,0 +1,6 @@
+// error-pattern: Unexpected token 'x'
+
+fn main() {
+ let int x = 5;
+ alt x;
+}
diff --git a/src/test/run-pass/alt-type-simple.rs b/src/test/run-pass/alt-type-simple.rs
new file mode 100644
index 00000000..85f6ff68
--- /dev/null
+++ b/src/test/run-pass/alt-type-simple.rs
@@ -0,0 +1,11 @@
+fn altsimple(any x) {
+ alt type (f) {
+ case (int i) { print("int"); }
+ case (str s) { print("str"); }
+ }
+}
+
+fn main() {
+ altsimple(5);
+ altsimple("asdfasdfsDF");
+}