about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-11-03 14:55:19 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-11-05 20:13:25 -0500
commit11f4baeafb83459befd0196b2b82cda7ed5ea2f1 (patch)
tree3a32c669d76eae74604ac3d931ba97804f3ef9a4
parent62168222493c8302e9f6b4291f0ba9e124e196cb (diff)
downloadrust-11f4baeafb83459befd0196b2b82cda7ed5ea2f1.tar.gz
rust-11f4baeafb83459befd0196b2b82cda7ed5ea2f1.zip
Fix tests
-rw-r--r--src/libcollections/slice.rs10
-rw-r--r--src/libcollections/str.rs10
-rw-r--r--src/libcollections/tree/map.rs14
-rw-r--r--src/test/compile-fail/deriving-no-inner-impl-error-message.rs4
4 files changed, 19 insertions, 19 deletions
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs
index eb4ff345b51..e4af5795e1c 100644
--- a/src/libcollections/slice.rs
+++ b/src/libcollections/slice.rs
@@ -1598,15 +1598,15 @@ mod tests {
     #[test]
     fn test_total_ord() {
         let c: &[int] = &[1, 2, 3];
-        [1, 2, 3, 4][].cmp(& c) == Greater;
+        [1, 2, 3, 4][].cmp(c) == Greater;
         let c: &[int] = &[1, 2, 3, 4];
-        [1, 2, 3][].cmp(& c) == Less;
+        [1, 2, 3][].cmp(c) == Less;
         let c: &[int] = &[1, 2, 3, 6];
-        [1, 2, 3, 4][].cmp(& c) == Equal;
+        [1, 2, 3, 4][].cmp(c) == Equal;
         let c: &[int] = &[1, 2, 3, 4, 5, 6];
-        [1, 2, 3, 4, 5, 5, 5, 5][].cmp(& c) == Less;
+        [1, 2, 3, 4, 5, 5, 5, 5][].cmp(c) == Less;
         let c: &[int] = &[1, 2, 3, 4];
-        [2, 2][].cmp(& c) == Greater;
+        [2, 2][].cmp(c) == Greater;
     }
 
     #[test]
diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs
index 79c1f720794..cdca0d10eed 100644
--- a/src/libcollections/str.rs
+++ b/src/libcollections/str.rs
@@ -1530,11 +1530,11 @@ mod tests {
 
     #[test]
     fn test_total_ord() {
-        "1234".cmp(&("123")) == Greater;
-        "123".cmp(&("1234")) == Less;
-        "1234".cmp(&("1234")) == Equal;
-        "12345555".cmp(&("123456")) == Less;
-        "22".cmp(&("1234")) == Greater;
+        "1234".cmp("123") == Greater;
+        "123".cmp("1234") == Less;
+        "1234".cmp("1234") == Equal;
+        "12345555".cmp("123456") == Less;
+        "22".cmp("1234") == Greater;
     }
 
     #[test]
diff --git a/src/libcollections/tree/map.rs b/src/libcollections/tree/map.rs
index 9742bddb1f6..8e24eabfccf 100644
--- a/src/libcollections/tree/map.rs
+++ b/src/libcollections/tree/map.rs
@@ -579,7 +579,7 @@ impl<K, V> TreeMap<K, V> {
     /// let headers = get_headers();
     /// let ua_key = "User-Agent";
     /// let ua = headers.find_with(|k| {
-    ///    ua_key.cmp(&k.as_slice())
+    ///    ua_key.cmp(k.as_slice())
     /// });
     ///
     /// assert_eq!((*ua.unwrap()).as_slice(), "Curl-Rust/0.1");
@@ -603,7 +603,7 @@ impl<K, V> TreeMap<K, V> {
     /// t.insert("User-Agent", "Curl-Rust/0.1");
     ///
     /// let new_ua = "Safari/156.0";
-    /// match t.find_with_mut(|k| "User-Agent".cmp(k)) {
+    /// match t.find_with_mut(|&k| "User-Agent".cmp(k)) {
     ///    Some(x) => *x = new_ua,
     ///    None => panic!(),
     /// }
@@ -1302,7 +1302,7 @@ mod test_treemap {
     #[test]
     fn find_with_empty() {
         let m: TreeMap<&'static str,int> = TreeMap::new();
-        assert!(m.find_with(|k| "test".cmp(k)) == None);
+        assert!(m.find_with(|&k| "test".cmp(k)) == None);
     }
 
     #[test]
@@ -1311,7 +1311,7 @@ mod test_treemap {
         assert!(m.insert("test1", 2i));
         assert!(m.insert("test2", 3i));
         assert!(m.insert("test3", 3i));
-        assert_eq!(m.find_with(|k| "test4".cmp(k)), None);
+        assert_eq!(m.find_with(|&k| "test4".cmp(k)), None);
     }
 
     #[test]
@@ -1320,7 +1320,7 @@ mod test_treemap {
         assert!(m.insert("test1", 2i));
         assert!(m.insert("test2", 3i));
         assert!(m.insert("test3", 4i));
-        assert_eq!(m.find_with(|k| "test2".cmp(k)), Some(&3i));
+        assert_eq!(m.find_with(|&k| "test2".cmp(k)), Some(&3i));
     }
 
     #[test]
@@ -1343,10 +1343,10 @@ mod test_treemap {
         assert!(m.insert("t2", 8));
         assert!(m.insert("t5", 14));
         let new = 100;
-        match m.find_with_mut(|k| "t5".cmp(k)) {
+        match m.find_with_mut(|&k| "t5".cmp(k)) {
           None => panic!(), Some(x) => *x = new
         }
-        assert_eq!(m.find_with(|k| "t5".cmp(k)), Some(&new));
+        assert_eq!(m.find_with(|&k| "t5".cmp(k)), Some(&new));
     }
 
     #[test]
diff --git a/src/test/compile-fail/deriving-no-inner-impl-error-message.rs b/src/test/compile-fail/deriving-no-inner-impl-error-message.rs
index 15a7bc01c3a..18be03f97d9 100644
--- a/src/test/compile-fail/deriving-no-inner-impl-error-message.rs
+++ b/src/test/compile-fail/deriving-no-inner-impl-error-message.rs
@@ -12,8 +12,8 @@ struct NoCloneOrEq;
 
 #[deriving(PartialEq)]
 struct E {
-    x: NoCloneOrEq //~ ERROR does not implement any method in scope named `eq`
-         //~^ ERROR does not implement any method in scope named `ne`
+    x: NoCloneOrEq //~ ERROR binary operation `==` cannot be applied to type `NoCloneOrEq`
+         //~^ ERROR binary operation `!=` cannot be applied to type `NoCloneOrEq`
 }
 #[deriving(Clone)]
 struct C {