about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/bitv.rs4
-rw-r--r--src/libcollections/dlist.rs4
-rw-r--r--src/libcollections/enum_set.rs2
-rw-r--r--src/libcollections/hashmap.rs4
-rw-r--r--src/libcollections/list.rs8
-rw-r--r--src/libcollections/lru_cache.rs2
-rw-r--r--src/libcollections/ringbuf.rs15
7 files changed, 20 insertions, 19 deletions
diff --git a/src/libcollections/bitv.rs b/src/libcollections/bitv.rs
index 0e14b28eda3..116bb80d8c0 100644
--- a/src/libcollections/bitv.rs
+++ b/src/libcollections/bitv.rs
@@ -1542,7 +1542,7 @@ mod tests {
 
         let mut b = a.clone();
 
-        assert_eq!(&a, &b);
+        assert!(a == b);
 
         assert!(b.remove(&1));
         assert!(a.contains(&1));
@@ -1561,7 +1561,7 @@ mod tests {
         let mut r = rng();
         let mut bitv = 0 as uint;
         b.iter(|| {
-            bitv |= (1 << ((r.next_u32() as uint) % uint::BITS));
+            bitv |= 1 << ((r.next_u32() as uint) % uint::BITS);
             &bitv
         })
     }
diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs
index 4a4ec01f6d2..6c059d3f40c 100644
--- a/src/libcollections/dlist.rs
+++ b/src/libcollections/dlist.rs
@@ -982,11 +982,11 @@ mod tests {
     fn test_eq() {
         let mut n: DList<u8> = list_from([]);
         let mut m = list_from([]);
-        assert_eq!(&n, &m);
+        assert!(n == m);
         n.push_front(1);
         assert!(n != m);
         m.push_back(1);
-        assert_eq!(&n, &m);
+        assert!(n == m);
 
         let n = list_from([2,3,4]);
         let m = list_from([1,2,3]);
diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs
index f33d77ba682..7fda99d8d2c 100644
--- a/src/libcollections/enum_set.rs
+++ b/src/libcollections/enum_set.rs
@@ -141,7 +141,7 @@ mod test {
 
     use enum_set::{EnumSet, CLike};
 
-    #[deriving(Eq)]
+    #[deriving(Eq, Show)]
     #[repr(uint)]
     enum Foo {
         A, B, C
diff --git a/src/libcollections/hashmap.rs b/src/libcollections/hashmap.rs
index 0ffe7c31bb8..b4b843289f8 100644
--- a/src/libcollections/hashmap.rs
+++ b/src/libcollections/hashmap.rs
@@ -1065,7 +1065,7 @@ mod test_map {
         let mut observed = 0;
         for (k, v) in m.iter() {
             assert_eq!(*v, *k * 2);
-            observed |= (1 << *k);
+            observed |= 1 << *k;
         }
         assert_eq!(observed, 0xFFFF_FFFF);
     }
@@ -1293,7 +1293,7 @@ mod test_set {
         }
         let mut observed = 0;
         for k in a.iter() {
-            observed |= (1 << *k);
+            observed |= 1 << *k;
         }
         assert_eq!(observed, 0xFFFF_FFFF);
     }
diff --git a/src/libcollections/list.rs b/src/libcollections/list.rs
index 2359b7ec769..18da9671419 100644
--- a/src/libcollections/list.rs
+++ b/src/libcollections/list.rs
@@ -153,7 +153,7 @@ mod tests {
     #[test]
     fn test_from_vec_empty() {
         let empty : list::List<int> = List::from_vec([]);
-        assert_eq!(empty, Nil::<int>);
+        assert!(empty == Nil::<int>);
     }
 
     #[test]
@@ -222,8 +222,8 @@ mod tests {
 
     #[test]
     fn test_append() {
-        assert_eq!(List::from_vec([1, 2, 3, 4]),
-                   List::from_vec([1, 2]).append(List::from_vec([3, 4])));
+        assert!(List::from_vec([1, 2, 3, 4]) ==
+                List::from_vec([1, 2]).append(List::from_vec([3, 4])));
     }
 
     #[test]
@@ -232,6 +232,6 @@ mod tests {
         let new_list = list.unshift(0);
         assert_eq!(list.len(), 1u);
         assert_eq!(new_list.len(), 2u);
-        assert_eq!(new_list, List::from_vec([0, 1]));
+        assert!(new_list == List::from_vec([0, 1]));
     }
 }
diff --git a/src/libcollections/lru_cache.rs b/src/libcollections/lru_cache.rs
index 68bc5f1b6c4..0aace71813e 100644
--- a/src/libcollections/lru_cache.rs
+++ b/src/libcollections/lru_cache.rs
@@ -277,7 +277,7 @@ mod tests {
 
     fn assert_opt_eq<V: Eq>(opt: Option<&V>, v: V) {
         assert!(opt.is_some());
-        assert_eq!(opt.unwrap(), &v);
+        assert!(opt.unwrap() == &v);
     }
 
     #[test]
diff --git a/src/libcollections/ringbuf.rs b/src/libcollections/ringbuf.rs
index 4b97bfbd18d..e09bf1023d6 100644
--- a/src/libcollections/ringbuf.rs
+++ b/src/libcollections/ringbuf.rs
@@ -409,6 +409,7 @@ mod tests {
     use deque::Deque;
     use std::clone::Clone;
     use std::cmp::Eq;
+    use std::fmt::Show;
     use super::RingBuf;
 
     #[test]
@@ -493,7 +494,7 @@ mod tests {
     }
 
     #[cfg(test)]
-    fn test_parameterized<T:Clone + Eq>(a: T, b: T, c: T, d: T) {
+    fn test_parameterized<T:Clone + Eq + Show>(a: T, b: T, c: T, d: T) {
         let mut deq = RingBuf::new();
         assert_eq!(deq.len(), 0);
         deq.push_front(a.clone());
@@ -578,21 +579,21 @@ mod tests {
         })
     }
 
-    #[deriving(Clone, Eq)]
+    #[deriving(Clone, Eq, Show)]
     enum Taggy {
         One(int),
         Two(int, int),
         Three(int, int, int),
     }
 
-    #[deriving(Clone, Eq)]
+    #[deriving(Clone, Eq, Show)]
     enum Taggypar<T> {
         Onepar(int),
         Twopar(int, int),
         Threepar(int, int, int),
     }
 
-    #[deriving(Clone, Eq)]
+    #[deriving(Clone, Eq, Show)]
     struct RecCy {
         x: int,
         y: int,
@@ -812,7 +813,7 @@ mod tests {
     #[test]
     fn test_eq() {
         let mut d = RingBuf::new();
-        assert_eq!(&d, &RingBuf::with_capacity(0));
+        assert!(d == RingBuf::with_capacity(0));
         d.push_front(137);
         d.push_front(17);
         d.push_front(42);
@@ -822,11 +823,11 @@ mod tests {
         e.push_back(17);
         e.push_back(137);
         e.push_back(137);
-        assert_eq!(&e, &d);
+        assert!(&e == &d);
         e.pop_back();
         e.push_back(0);
         assert!(e != d);
         e.clear();
-        assert_eq!(e, RingBuf::new());
+        assert!(e == RingBuf::new());
     }
 }