summary refs log tree commit diff
path: root/src/test/run-pass/structured-compare.rs
blob: aebebec12996dae774fa525bf4d98a4771991ac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19


enum foo { large, small, }

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