aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/expr-alt.rs
blob: 420ccbc9cba95c26a1a0470db01023e561960cbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// xfail-boot
// -*- rust -*-

// Tests for using alt as an expression

fn test() {
  let bool res = alt (true) {
    case (true) {
      true
    }
    case (false) {
      false
    }
  };
  check (res);

  res = alt(false) {
    case (true) {
      false
    }
    case (false) {
      true
    }
  };
  check (res);
}

fn main() {
  test();
}