add tests

This commit is contained in:
Jennifer Chukwu 2024-04-30 16:25:35 +00:00
parent 5e8779957e
commit 825d078294
1 changed files with 9 additions and 1 deletions

View File

@ -931,7 +931,7 @@ mod inversion_tests {
use super::*; use super::*;
use crate::proptest::*; use crate::proptest::*;
use na::Matrix1; use na::Matrix1;
use proptest::{prop_assert, proptest}; use proptest::{prop_assert, proptest, prop_assert_eq};
proptest! { proptest! {
#[test] #[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] #[test]
fn self_mul_inv_is_id_dim6(m in matrix6()) { fn self_mul_inv_is_id_dim6(m in matrix6()) {
if let Some(im) = m.try_inverse() { if let Some(im) = m.try_inverse() {