/src/test/run-pass/alt-str.rs
http://github.com/jruderman/rust · Rust · 21 lines · 13 code · 7 blank · 1 comment · 5 complexity · 579bd4524d316d4dbf63712c73f37c31 MD5 · raw file
- // Issue #53
- fn main() {
- match check ~"test" { ~"not-test" => fail, ~"test" => (), _ => fail }
- enum t { tag1(~str), tag2, }
- match tag1(~"test") {
- tag2 => fail,
- tag1(~"not-test") => fail,
- tag1(~"test") => (),
- _ => fail
- }
- let x = match check ~"a" { ~"a" => 1, ~"b" => 2 };
- assert (x == 1);
- match check ~"a" { ~"a" => { } ~"b" => { } }
- }