Add DoubleEndedIterator test

This commit is contained in:
Remco Bloemen 2020-11-19 09:27:34 -08:00 committed by Crozet Sébastien
parent adc82845d1
commit dcd87287bf
1 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,15 @@ fn iter() {
assert_eq!(*it.next().unwrap(), 6.0); assert_eq!(*it.next().unwrap(), 6.0);
assert!(it.next().is_none()); assert!(it.next().is_none());
let mut it = a.iter();
assert_eq!(*it.next().unwrap(), 1.0);
assert_eq!(*it.next_back().unwrap(), 6.0);
assert_eq!(*it.next_back().unwrap(), 3.0);
assert_eq!(*it.next_back().unwrap(), 5.0);
assert_eq!(*it.next().unwrap(), 4.0);
assert_eq!(*it.next().unwrap(), 2.0);
assert!(it.next().is_none());
let row = a.row(0); let row = a.row(0);
let mut it = row.iter(); let mut it = row.iter();
assert_eq!(*it.next().unwrap(), 1.0); assert_eq!(*it.next().unwrap(), 1.0);