Navigation Menu

Skip to content

Commit

Permalink
string: Add test for FromIterator<&str> and Extend<&str>
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Dec 7, 2014
1 parent 56c4e97 commit a813469
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/libcollections/string.rs
Expand Up @@ -1337,11 +1337,18 @@ mod tests {
let u = "Việt Nam";

let a: String = s.chars().collect();
assert_eq!(s, a.as_slice());
assert_eq!(s, a);

let mut b = t.to_string();
b.extend(u.chars());
assert_eq!(s, b.as_slice());
assert_eq!(s, b);

let c: String = vec![t, u].into_iter().collect();
assert_eq!(s, c);

let mut d = t.to_string();
d.extend(vec![u].into_iter());
assert_eq!(s, d);
}

#[bench]
Expand Down

0 comments on commit a813469

Please sign in to comment.