From e3a08c9b60f363708ff9d3d713cd70f290252fc2 Mon Sep 17 00:00:00 2001 From: Jennifer Chukwu Date: Thu, 2 May 2024 10:16:45 +0000 Subject: [PATCH] test with a fixed input --- tests/core/matrix.rs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/core/matrix.rs b/tests/core/matrix.rs index 62b2efb8..757fef98 100644 --- a/tests/core/matrix.rs +++ b/tests/core/matrix.rs @@ -931,7 +931,7 @@ mod inversion_tests { use super::*; use crate::proptest::*; use na::Matrix1; - use proptest::{prop_assert, proptest, prop_assert_eq}; + use proptest::{prop_assert, proptest}; proptest! { #[test] @@ -970,14 +970,6 @@ mod inversion_tests { } } - #[test] - fn test_inversion_failure_leaves_matrix_unchanged(m in matrix4()) { - let original_matrix = m.clone(); - if m.try_inverse().is_none() { - prop_assert_eq!(m, original_matrix); - } - } - #[test] fn self_mul_inv_is_id_dim6(m in matrix6()) { if let Some(im) = m.try_inverse() { @@ -1271,6 +1263,20 @@ fn column_iterator_double_ended_mut() { assert_eq!(col_iter_mut.next(), None); } +#[test] +fn test_inversion_failure_leaves_matrix_unchanged() { + let mut mat = na::Matrix4::new( + 1.0, 2.0, 3.0, 4.0, + 2.0, 4.0, 6.0, 8.0, + 3.0, 6.0, 9.0, 12.0, + 4.0, 8.0, 12.0, 16.0 + ); + let expected = mat.clone(); + if !mat.try_inverse_mut() { + assert_eq!(mat, expected); + } +} + #[test] #[cfg(feature = "rayon")] fn parallel_column_iteration() {