rust/src/test/run-pass/structured-compare.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

20 lines
425 B
Rust

tag 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);
}