#![allow(bad_style)] #![allow(clippy::float_cmp)] use hektor::*; #[test] fn Vec2_getters() { let v = Vec2::new(1.0, 2.0); assert_eq!(v.x(), 1.0); assert_eq!(v.y(), 2.0); } #[test] fn Vec3_getters() { let v = Vec3::new(1.0, 2.0, 3.0); assert_eq!(v.x(), 1.0); assert_eq!(v.y(), 2.0); assert_eq!(v.z(), 3.0); } #[test] fn Vec4_getters() { let v = Vec4::new(1.0, 2.0, 3.0, 4.0); assert_eq!(v.x(), 1.0); assert_eq!(v.y(), 2.0); assert_eq!(v.z(), 3.0); assert_eq!(v.w(), 4.0); } #[test] fn Mat2_getters() { let x_axis = Vec2::new(1.0, 2.0); let y_axis = Vec2::new(11.0, 12.0); let m = Mat2::new(x_axis, y_axis); assert_eq!(m.x_axis(), x_axis); assert_eq!(m.y_axis(), y_axis); } #[test] fn Mat3_getters() { let x_axis = Vec3::new(1.0, 2.0, 3.0); let y_axis = Vec3::new(11.0, 12.0, 13.0); let z_axis = Vec3::new(21.0, 22.0, 23.0); let m = Mat3::new(x_axis, y_axis, z_axis); assert_eq!(m.x_axis(), x_axis); assert_eq!(m.y_axis(), y_axis); assert_eq!(m.z_axis(), z_axis); } #[test] fn Mat4_getters() { let x_axis = Vec4::new(1.0, 2.0, 3.0, 4.0); let y_axis = Vec4::new(11.0, 12.0, 13.0, 14.0); let z_axis = Vec4::new(21.0, 22.0, 23.0, 24.0); let w_axis = Vec4::new(31.0, 32.0, 33.0, 34.0); let m = Mat4::new(x_axis, y_axis, z_axis, w_axis); assert_eq!(m.x_axis(), x_axis); assert_eq!(m.y_axis(), y_axis); assert_eq!(m.z_axis(), z_axis); assert_eq!(m.w_axis(), w_axis); } #[test] fn Quat_getters() { let q = Quat::new(1.0, 2.0, 3.0, 4.0); assert_eq!(q.a(), 1.0); assert_eq!(q.b(), 2.0); assert_eq!(q.c(), 3.0); assert_eq!(q.d(), 4.0); }