Skip to content

Commit 93de60e

Browse files
author
blake2-ppc
committed
std::str: Add test for CharIterator .clone()
1 parent 8fe8302 commit 93de60e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libstd/str.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3139,6 +3139,14 @@ mod tests {
31393139
assert_eq!(pos, v.len());
31403140
}
31413141
3142+
#[test]
3143+
fn test_iterator_clone() {
3144+
let s = "ศไทย中华Việt Nam";
3145+
let mut it = s.iter();
3146+
it.next();
3147+
assert!(it.zip(it.clone()).all(|(x,y)| x == y));
3148+
}
3149+
31423150
#[test]
31433151
fn test_byte_iterator() {
31443152
let s = ~"ศไทย中华Việt Nam";

0 commit comments

Comments
 (0)