Skip to content

Commit

Permalink
Add some tests for affine types mul_assign ops.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitshifter committed Sep 22, 2023
1 parent 030c4e2 commit cd822d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/affine2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ macro_rules! impl_affine2_tests {
assert_approx_eq!(m0, m0 * $affine2::IDENTITY);
assert_approx_eq!(m0, $affine2::IDENTITY * m0);

let mut m1 = m0;
m1 *= $affine2::IDENTITY;
assert_approx_eq!(m1, m0);

let mat3 = $mat3::from(m0);
assert_approx_eq!(mat3, $affine2::IDENTITY * mat3);
assert_approx_eq!(mat3, mat3 * $affine2::IDENTITY);
Expand Down
4 changes: 4 additions & 0 deletions tests/affine3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ macro_rules! impl_affine3_tests {
assert_approx_eq!(m0, m0 * $affine3::IDENTITY);
assert_approx_eq!(m0, $affine3::IDENTITY * m0);

let mut m1 = m0;
m1 *= $affine3::IDENTITY;
assert_approx_eq!(m1, m0);

let mat4 = $mat4::from(m0);
assert_approx_eq!(mat4, $affine3::IDENTITY * mat4);
assert_approx_eq!(mat4, mat4 * $affine3::IDENTITY);
Expand Down

0 comments on commit cd822d1

Please sign in to comment.