#![allow(bad_style)] #![allow(clippy::float_cmp)] use hektor::*; #[test] fn Vec2_neg() { let v1 = Vec2::new(1.0, 2.0); assert_eq!(-v1, Vec2::new(-1.0, -2.0)); } #[test] fn Vec3_neg() { let v1 = Vec3::new(1.0, 2.0, 3.0); assert_eq!(-v1, Vec3::new(-1.0, -2.0, -3.0)); } #[test] fn Vec4_neg() { let v1 = Vec4::new(1.0, 2.0, 3.0, 4.0); assert_eq!(-v1, Vec4::new(-1.0, -2.0, -3.0, -4.0)); } #[test] fn Mat2_neg() { let m1_x = Vec2::new(1.0, 2.0); let m1_y = Vec2::new(3.0, 4.0); let m1 = Mat2::new(m1_x, m1_y); // assert_eq!(-m1, Mat2::new(-m1_x, -m1_y)); } #[test] fn Mat3_neg() { let m1_x = Vec3::new(1.0, 2.0, 7.0); let m1_y = Vec3::new(3.0, 4.0, 8.0); let m1_z = Vec3::new(5.0, 6.0, 9.0); let m1 = Mat3::new(m1_x, m1_y, m1_z); // assert_eq!(-m1, Mat3::new(-m1_x, -m1_y, -m1_z)); } #[test] fn Mat4_neg() { let m1_x = Vec4::new(1.0, 2.0, 7.0, 12.0); let m1_y = Vec4::new(3.0, 4.0, 8.0, 1.5); let m1_z = Vec4::new(5.0, 6.0, 9.0, -80.0); let m1_w = Vec4::new(52.0, 63.0, 94.0, 67.0); let m1 = Mat4::new(m1_x, m1_y, m1_z, m1_w); // assert_eq!(-m1, Mat4::new(-m1_x, -m1_y, -m1_z, -m1_w)); }