diff options
| author | Graydon Hoare <[email protected]> | 2010-08-23 18:19:42 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-08-23 18:19:42 -0700 |
| commit | 6e3a77c3a3b32aa6fabad895492c2b24739fedba (patch) | |
| tree | 5e92169975465400c1f617c39fcbacf9bffab706 /src/test | |
| parent | Warn when the value of "spawn" is unused, as it's useless (diff) | |
| parent | Modified parser to handle alt type andadded a few tests (diff) | |
| download | rust-6e3a77c3a3b32aa6fabad895492c2b24739fedba.tar.xz rust-6e3a77c3a3b32aa6fabad895492c2b24739fedba.zip | |
Merge remote branch 'tohava/master'
Conflicts:
src/boot/fe/ast.ml
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/bad-alt.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/alt-type-simple.rs | 11 |
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"); +} |