summary refs log tree commit diff
path: root/src/test/run-pass/alt-str.rs
blob: 6b7a3e6c2792d58b2db21f9eeb55e87a3cc44608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Issue #53

fn main() {
    alt "test" { "not-test" { fail; } "test" { } _ { fail; } }

    enum t { tag1(str), 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" { } }

}