about summary refs log tree commit diff
path: root/src/libsyntax/util
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2013-01-30 09:56:33 -0800
committerJohn Clements <clements@racket-lang.org>2013-01-31 23:05:12 -0800
commit53688addaa4484f1a317bb0938cf453381810427 (patch)
tree2c025b1dc64129e4651df886918a07af9896a14f /src/libsyntax/util
parente343abd0ed11227425eca16e186367eced39cd82 (diff)
test cases, cleanup
Diffstat (limited to 'src/libsyntax/util')
-rw-r--r--src/libsyntax/util/testing.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libsyntax/util/testing.rs b/src/libsyntax/util/testing.rs
new file mode 100644
index 00000000000..d70e503a568
--- /dev/null
+++ b/src/libsyntax/util/testing.rs
@@ -0,0 +1,24 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// support for test cases.
+use core::cmp;
+
+pub pure fn check_equal_ptr<T : cmp::Eq> (given : &T, expected: &T) {
+    if !((given == expected) && (expected == given )) {
+        fail (fmt!("given %?, expected %?",given,expected));
+    }
+}
+
+pub pure fn check_equal<T : cmp::Eq> (given : T, expected: T) {
+    if !((given == expected) && (expected == given )) {
+        fail (fmt!("given %?, expected %?",given,expected));
+    }
+}