Skip to content

Commit

Permalink
test with a fixed input
Browse files Browse the repository at this point in the history
  • Loading branch information
jnyfah committed May 2, 2024
1 parent 825d078 commit e3a08c9
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions tests/core/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit e3a08c9

Please sign in to comment.