From dcd87287bf1eb91a1c1656c645c8608ddd0cf607 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Thu, 19 Nov 2020 09:27:34 -0800 Subject: [PATCH] Add DoubleEndedIterator test --- tests/core/matrix.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/core/matrix.rs b/tests/core/matrix.rs index ed7b26d2..6b248593 100644 --- a/tests/core/matrix.rs +++ b/tests/core/matrix.rs @@ -21,6 +21,15 @@ fn iter() { assert_eq!(*it.next().unwrap(), 6.0); 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 mut it = row.iter(); assert_eq!(*it.next().unwrap(), 1.0);