diff options
Diffstat (limited to 'src/test/run-pass/send_str_treemap.rs')
| -rw-r--r-- | src/test/run-pass/send_str_treemap.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/test/run-pass/send_str_treemap.rs b/src/test/run-pass/send_str_treemap.rs index 2f3ddb8589c..ce748d8684d 100644 --- a/src/test/run-pass/send_str_treemap.rs +++ b/src/test/run-pass/send_str_treemap.rs @@ -19,35 +19,35 @@ use std::option::Some; pub fn main() { let mut map: TreeMap<SendStr, uint> = TreeMap::new(); assert!(map.insert(Slice("foo"), 42)); - assert!(!map.insert(Owned(~"foo"), 42)); + assert!(!map.insert(Owned("foo".to_owned()), 42)); assert!(!map.insert(Slice("foo"), 42)); - assert!(!map.insert(Owned(~"foo"), 42)); + assert!(!map.insert(Owned("foo".to_owned()), 42)); assert!(!map.insert(Slice("foo"), 43)); - assert!(!map.insert(Owned(~"foo"), 44)); + assert!(!map.insert(Owned("foo".to_owned()), 44)); assert!(!map.insert(Slice("foo"), 45)); - assert!(!map.insert(Owned(~"foo"), 46)); + assert!(!map.insert(Owned("foo".to_owned()), 46)); let v = 46; - assert_eq!(map.find(&Owned(~"foo")), Some(&v)); + assert_eq!(map.find(&Owned("foo".to_owned())), Some(&v)); assert_eq!(map.find(&Slice("foo")), Some(&v)); let (a, b, c, d) = (50, 51, 52, 53); assert!(map.insert(Slice("abc"), a)); - assert!(map.insert(Owned(~"bcd"), b)); + assert!(map.insert(Owned("bcd".to_owned()), b)); assert!(map.insert(Slice("cde"), c)); - assert!(map.insert(Owned(~"def"), d)); + assert!(map.insert(Owned("def".to_owned()), d)); assert!(!map.insert(Slice("abc"), a)); - assert!(!map.insert(Owned(~"bcd"), b)); + assert!(!map.insert(Owned("bcd".to_owned()), b)); assert!(!map.insert(Slice("cde"), c)); - assert!(!map.insert(Owned(~"def"), d)); + assert!(!map.insert(Owned("def".to_owned()), d)); - assert!(!map.insert(Owned(~"abc"), a)); + assert!(!map.insert(Owned("abc".to_owned()), a)); assert!(!map.insert(Slice("bcd"), b)); - assert!(!map.insert(Owned(~"cde"), c)); + assert!(!map.insert(Owned("cde".to_owned()), c)); assert!(!map.insert(Slice("def"), d)); assert_eq!(map.find(&Slice("abc")), Some(&a)); @@ -55,14 +55,14 @@ pub fn main() { assert_eq!(map.find(&Slice("cde")), Some(&c)); assert_eq!(map.find(&Slice("def")), Some(&d)); - assert_eq!(map.find(&Owned(~"abc")), Some(&a)); - assert_eq!(map.find(&Owned(~"bcd")), Some(&b)); - assert_eq!(map.find(&Owned(~"cde")), Some(&c)); - assert_eq!(map.find(&Owned(~"def")), Some(&d)); + assert_eq!(map.find(&Owned("abc".to_owned())), Some(&a)); + assert_eq!(map.find(&Owned("bcd".to_owned())), Some(&b)); + assert_eq!(map.find(&Owned("cde".to_owned())), Some(&c)); + assert_eq!(map.find(&Owned("def".to_owned())), Some(&d)); assert!(map.pop(&Slice("foo")).is_some()); assert_eq!(map.move_iter().map(|(k, v)| k.to_str() + v.to_str()) .collect::<~[~str]>() .concat(), - ~"abc50bcd51cde52def53"); + "abc50bcd51cde52def53".to_owned()); } |
