about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2013-03-13 15:30:37 -0700
committerJohn Clements <clements@racket-lang.org>2013-03-20 16:05:59 -0700
commit3cd65c233d750cd37982911602db79d29e6f5874 (patch)
tree0e558145a765241119fa002bc7e78c8fa25f3084 /src/libstd
parentab8e46b0660e076e629e6775ed8da9890c5fbf1f (diff)
downloadrust-3cd65c233d750cd37982911602db79d29e6f5874.tar.gz
rust-3cd65c233d750cd37982911602db79d29e6f5874.zip
change some uses of fail_unless to assert_eq
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/json.rs20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/libstd/json.rs b/src/libstd/json.rs
index f2f37604fb5..921a225f7ca 100644
--- a/src/libstd/json.rs
+++ b/src/libstd/json.rs
@@ -1284,20 +1284,6 @@ mod tests {
         fail_unless!(a == b);
     }
 
-    // two fns copied from libsyntax/util/testing.rs.
-    // Should they be in their own crate?
-    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));
-        }
-    }
-
     #[test]
     fn test_write_enum () {
         let bw = @io::BytesWriter();
@@ -1315,7 +1301,7 @@ mod tests {
                 }
             }
         }
-        check_equal(str::from_bytes(bw.bytes), ~"[\"frog\",[\"Henry\",349]]");
+        assert_eq!(str::from_bytes(bw.bytes), ~"[\"frog\",[\"Henry\",349]]");
     }
 
     #[test]
@@ -1330,7 +1316,7 @@ mod tests {
                 }
             }
         }
-        check_equal(str::from_bytes(bw.bytes), ~"\"jodhpurs\"");
+        assert_eq!(str::from_bytes(bw.bytes), ~"\"jodhpurs\"");
     }
 
     #[test]
@@ -1342,7 +1328,7 @@ mod tests {
             do encoder.emit_enum_variant (~"None",37,1242) {
             }
         }
-        check_equal(str::from_bytes(bw.bytes), ~"null");
+        assert_eq!(str::from_bytes(bw.bytes), ~"null");
     }
 
     #[test]