test: Add test for string matching in pattern alts. Closes #53
This commit is contained in:
parent
54566e9037
commit
7105cd1761
21
src/test/run-pass/alt-str.rs
Normal file
21
src/test/run-pass/alt-str.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// Issue #53
|
||||
|
||||
fn main() {
|
||||
alt ("test") {
|
||||
case ("not-test") { fail; }
|
||||
case ("test") { }
|
||||
case (_) { fail; }
|
||||
}
|
||||
|
||||
tag t {
|
||||
tag1(str);
|
||||
tag2;
|
||||
}
|
||||
|
||||
alt (tag1("test")) {
|
||||
case (tag2) { fail; }
|
||||
case (tag1("not-test")) { fail; }
|
||||
case (tag1("test")) { }
|
||||
case (_) { fail; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user