rust/src/test/run-pass/alt-str.rs
2011-09-01 12:14:36 -07:00

32 lines
416 B
Rust

// Issue #53
fn main() {
alt ~"test" {
~"not-test" { fail; }
~"test" { }
_ { fail; }
}
tag t { tag1(istr); tag2; }
alt tag1(~"test") {
tag2. { fail; }
tag1(~"not-test") { fail; }
tag1(~"test") { }
_ { fail; }
}
let x = alt ~"a" {
~"a" { 1 }
~"b" { 2 }
};
assert x == 1;
alt ~"a" {
~"a" { }
~"b" { }
}
}