diff --git a/rtchallenge/src/matrices.rs b/rtchallenge/src/matrices.rs index 2d6d96e..cde3253 100644 --- a/rtchallenge/src/matrices.rs +++ b/rtchallenge/src/matrices.rs @@ -307,4 +307,36 @@ mod tests { assert_eq!(m[(3, 0)], 13.5); assert_eq!(m[(3, 2)], 15.5); } + #[test] + fn equality4x4() { + let a = Matrix4x4::new( + [1., 2., 3., 4.], + [5., 6., 7., 8.], + [9., 8., 7., 6.], + [5., 4., 3., 2.], + ); + let b = Matrix4x4::new( + [1., 2., 3., 4.], + [5., 6., 7., 8.], + [9., 8., 7., 6.], + [5., 4., 3., 2.], + ); + assert_eq!(a, b); + } + #[test] + fn inequality4x4() { + let a = Matrix4x4::new( + [1., 2., 3., 4.], + [5., 6., 7., 8.], + [9., 8., 7., 6.], + [5., 4., 3., 2.], + ); + let b = Matrix4x4::new( + [2., 3., 4., 5.], + [6., 7., 8., 9.], + [8., 7., 6., 5.], + [4., 3., 2., 1.], + ); + assert_ne!(a, b); + } }