test with a fixed input

This commit is contained in:
Jennifer Chukwu 2024-05-02 10:16:45 +00:00
parent 825d078294
commit e3a08c9b60

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, prop_assert_eq}; use proptest::{prop_assert, proptest};
proptest! { proptest! {
#[test] #[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] #[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() {
@ -1271,6 +1263,20 @@ fn column_iterator_double_ended_mut() {
assert_eq!(col_iter_mut.next(), None); 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] #[test]
#[cfg(feature = "rayon")] #[cfg(feature = "rayon")]
fn parallel_column_iteration() { fn parallel_column_iteration() {