From dd31f09105010739b5fb2dfa4a97f18329890eeb Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Thu, 19 Nov 2020 11:27:48 -0800 Subject: [PATCH] Test reverse --- tests/core/matrix.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/core/matrix.rs b/tests/core/matrix.rs index 6b248593..80ab3554 100644 --- a/tests/core/matrix.rs +++ b/tests/core/matrix.rs @@ -11,6 +11,7 @@ use na::{ #[test] fn iter() { let a = Matrix2x3::new(1.0, 2.0, 3.0, 4.0, 5.0, 6.0); + dbg!(a); let mut it = a.iter(); assert_eq!(*it.next().unwrap(), 1.0); @@ -30,6 +31,15 @@ fn iter() { assert_eq!(*it.next().unwrap(), 2.0); assert!(it.next().is_none()); + let mut it = a.iter().rev(); + assert_eq!(*it.next().unwrap(), 6.0); + assert_eq!(*it.next().unwrap(), 3.0); + assert_eq!(*it.next().unwrap(), 5.0); + assert_eq!(*it.next().unwrap(), 2.0); + assert_eq!(*it.next().unwrap(), 4.0); + assert_eq!(*it.next().unwrap(), 1.0); + assert!(it.next().is_none()); + let row = a.row(0); let mut it = row.iter(); assert_eq!(*it.next().unwrap(), 1.0);