From 825d0782944699c467de24fa2d666cf30fdb2d9e Mon Sep 17 00:00:00 2001 From: Jennifer Chukwu Date: Tue, 30 Apr 2024 16:25:35 +0000 Subject: [PATCH] add tests --- tests/core/matrix.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/core/matrix.rs b/tests/core/matrix.rs index 501a0566..62b2efb8 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}; + use proptest::{prop_assert, proptest, prop_assert_eq}; proptest! { #[test] @@ -970,6 +970,14 @@ 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() {