From 9f0a6c21b2de2247eccbfb1b72137db5c7dd5173 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 21 Sep 2010 11:47:10 -0700 Subject: Implement preliminary form of structured compare. No boxes, vectors or strings yet. --- src/test/run-pass/structured-compare.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/run-pass/structured-compare.rs (limited to 'src/test') diff --git a/src/test/run-pass/structured-compare.rs b/src/test/run-pass/structured-compare.rs new file mode 100644 index 00000000..fed4b183 --- /dev/null +++ b/src/test/run-pass/structured-compare.rs @@ -0,0 +1,20 @@ +tag foo { + large; + small; +} + +fn main() { + auto a = tup(1,2,3); + auto b = tup(1,2,3); + check (a == b); + check (a != tup(1,2,4)); + check (a < tup(1,2,4)); + check (a <= tup(1,2,4)); + check (tup(1,2,4) > a); + check (tup(1,2,4) >= a); + auto x = large; + auto y = small; + check (x != y); + check (x == large); + check (x != small); +} \ No newline at end of file -- cgit v1.2.3