Skip to content

Commit

Permalink
Test DoubleEndedIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
choznerol committed Sep 26, 2023
1 parent 09e6fe5 commit 42e1f79
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/titlecase/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,17 @@ mod tests {
assert!(min <= count);
assert!(count <= max.unwrap());
}

#[test]
fn double_ended_iterator() {
let mut iter = Titlecase::with_slice(b"abc");
assert_eq!(iter.next_back(), Some(b'c'));
assert_eq!(iter.next_back(), Some(b'b'));
assert_eq!(iter.next_back(), Some(b'A'));

let mut iter = Titlecase::with_slice(b"abc");
assert_eq!(iter.next(), Some(b'A'));
assert_eq!(iter.next_back(), Some(b'c'));
assert_eq!(iter.next_back(), Some(b'B')); // FIXME: Should be 'b'
}
}

0 comments on commit 42e1f79

Please sign in to comment.