Skip to content

Commit 11f4bae

Browse files
author
Jorge Aparicio
committed
Fix tests
1 parent 6216822 commit 11f4bae

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

src/libcollections/slice.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1598,15 +1598,15 @@ mod tests {
15981598
#[test]
15991599
fn test_total_ord() {
16001600
let c: &[int] = &[1, 2, 3];
1601-
[1, 2, 3, 4][].cmp(& c) == Greater;
1601+
[1, 2, 3, 4][].cmp(c) == Greater;
16021602
let c: &[int] = &[1, 2, 3, 4];
1603-
[1, 2, 3][].cmp(& c) == Less;
1603+
[1, 2, 3][].cmp(c) == Less;
16041604
let c: &[int] = &[1, 2, 3, 6];
1605-
[1, 2, 3, 4][].cmp(& c) == Equal;
1605+
[1, 2, 3, 4][].cmp(c) == Equal;
16061606
let c: &[int] = &[1, 2, 3, 4, 5, 6];
1607-
[1, 2, 3, 4, 5, 5, 5, 5][].cmp(& c) == Less;
1607+
[1, 2, 3, 4, 5, 5, 5, 5][].cmp(c) == Less;
16081608
let c: &[int] = &[1, 2, 3, 4];
1609-
[2, 2][].cmp(& c) == Greater;
1609+
[2, 2][].cmp(c) == Greater;
16101610
}
16111611

16121612
#[test]

src/libcollections/str.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1530,11 +1530,11 @@ mod tests {
15301530

15311531
#[test]
15321532
fn test_total_ord() {
1533-
"1234".cmp(&("123")) == Greater;
1534-
"123".cmp(&("1234")) == Less;
1535-
"1234".cmp(&("1234")) == Equal;
1536-
"12345555".cmp(&("123456")) == Less;
1537-
"22".cmp(&("1234")) == Greater;
1533+
"1234".cmp("123") == Greater;
1534+
"123".cmp("1234") == Less;
1535+
"1234".cmp("1234") == Equal;
1536+
"12345555".cmp("123456") == Less;
1537+
"22".cmp("1234") == Greater;
15381538
}
15391539

15401540
#[test]

src/libcollections/tree/map.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ impl<K, V> TreeMap<K, V> {
579579
/// let headers = get_headers();
580580
/// let ua_key = "User-Agent";
581581
/// let ua = headers.find_with(|k| {
582-
/// ua_key.cmp(&k.as_slice())
582+
/// ua_key.cmp(k.as_slice())
583583
/// });
584584
///
585585
/// assert_eq!((*ua.unwrap()).as_slice(), "Curl-Rust/0.1");
@@ -603,7 +603,7 @@ impl<K, V> TreeMap<K, V> {
603603
/// t.insert("User-Agent", "Curl-Rust/0.1");
604604
///
605605
/// let new_ua = "Safari/156.0";
606-
/// match t.find_with_mut(|k| "User-Agent".cmp(k)) {
606+
/// match t.find_with_mut(|&k| "User-Agent".cmp(k)) {
607607
/// Some(x) => *x = new_ua,
608608
/// None => panic!(),
609609
/// }
@@ -1302,7 +1302,7 @@ mod test_treemap {
13021302
#[test]
13031303
fn find_with_empty() {
13041304
let m: TreeMap<&'static str,int> = TreeMap::new();
1305-
assert!(m.find_with(|k| "test".cmp(k)) == None);
1305+
assert!(m.find_with(|&k| "test".cmp(k)) == None);
13061306
}
13071307

13081308
#[test]
@@ -1311,7 +1311,7 @@ mod test_treemap {
13111311
assert!(m.insert("test1", 2i));
13121312
assert!(m.insert("test2", 3i));
13131313
assert!(m.insert("test3", 3i));
1314-
assert_eq!(m.find_with(|k| "test4".cmp(k)), None);
1314+
assert_eq!(m.find_with(|&k| "test4".cmp(k)), None);
13151315
}
13161316

13171317
#[test]
@@ -1320,7 +1320,7 @@ mod test_treemap {
13201320
assert!(m.insert("test1", 2i));
13211321
assert!(m.insert("test2", 3i));
13221322
assert!(m.insert("test3", 4i));
1323-
assert_eq!(m.find_with(|k| "test2".cmp(k)), Some(&3i));
1323+
assert_eq!(m.find_with(|&k| "test2".cmp(k)), Some(&3i));
13241324
}
13251325

13261326
#[test]
@@ -1343,10 +1343,10 @@ mod test_treemap {
13431343
assert!(m.insert("t2", 8));
13441344
assert!(m.insert("t5", 14));
13451345
let new = 100;
1346-
match m.find_with_mut(|k| "t5".cmp(k)) {
1346+
match m.find_with_mut(|&k| "t5".cmp(k)) {
13471347
None => panic!(), Some(x) => *x = new
13481348
}
1349-
assert_eq!(m.find_with(|k| "t5".cmp(k)), Some(&new));
1349+
assert_eq!(m.find_with(|&k| "t5".cmp(k)), Some(&new));
13501350
}
13511351

13521352
#[test]

src/test/compile-fail/deriving-no-inner-impl-error-message.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct NoCloneOrEq;
1212

1313
#[deriving(PartialEq)]
1414
struct E {
15-
x: NoCloneOrEq //~ ERROR does not implement any method in scope named `eq`
16-
//~^ ERROR does not implement any method in scope named `ne`
15+
x: NoCloneOrEq //~ ERROR binary operation `==` cannot be applied to type `NoCloneOrEq`
16+
//~^ ERROR binary operation `!=` cannot be applied to type `NoCloneOrEq`
1717
}
1818
#[deriving(Clone)]
1919
struct C {

0 commit comments

Comments
 (0)