aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/structured-compare.rs
blob: e677c3cb0bf878ece83f12773e1e2b66c7875411 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
tag foo {
  large;
  small;
}

fn main() {
  auto a = tup(1,2,3);
  auto b = tup(1,2,3);
  assert (a == b);
  assert (a != tup(1,2,4));
  assert (a < tup(1,2,4));
  assert (a <= tup(1,2,4));
  assert (tup(1,2,4) > a);
  assert (tup(1,2,4) >= a);
  auto x = large;
  auto y = small;
  assert (x != y);
  assert (x == large);
  assert (x != small);
}