aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/expr-alt.rs
blob: 22cdf32a672302e20e6f75662c868de94a593684 (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
31
// xfail-boot
// xfail-stage0
// -*- 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();
}