std::str: Add test for CharIterator .clone()

This commit is contained in:
blake2-ppc
2013-08-22 00:35:16 +02:00
parent 8fe8302887
commit 93de60e511

View File

@@ -3139,6 +3139,14 @@ mod tests {
assert_eq!(pos, v.len());
}
#[test]
fn test_iterator_clone() {
let s = "ศไทย中华Việt Nam";
let mut it = s.iter();
it.next();
assert!(it.zip(it.clone()).all(|(x,y)| x == y));
}
#[test]
fn test_byte_iterator() {
let s = ~"ศไทย中华Việt Nam";