#![allow(bad_style)] #![allow(clippy::float_cmp)] use hektor::*; #[test] fn Vec2_length() { let v = Vec2::new(3.0, 4.0); assert_eq!(v.length(), 5.0); } #[test] fn Vec3_length() { let v = Vec3::new(3.0, 4.0, 5.0); assert_eq!(v.length(), lokacore::sqrt_f32(50.0)); } #[test] fn Vec4_length() { let v = Vec4::new(3.0, 4.0, 5.0, 6.0); assert_eq!(v.length(), lokacore::sqrt_f32(86.0)); } #[test] fn Quat_length() { let q = Quat::new(3.0, 4.0, 5.0, 6.0); assert_eq!(q.length(), lokacore::sqrt_f32(86.0)); } // #[test] fn Vec2_length2() { let v = Vec2::new(3.0, 4.0); assert_eq!(v.length2(), 25.0); } #[test] fn Vec3_length2() { let v = Vec3::new(3.0, 4.0, 5.0); assert_eq!(v.length2(), 50.0); } #[test] fn Vec4_length2() { let v = Vec4::new(3.0, 4.0, 5.0, 6.0); assert_eq!(v.length2(), 86.0); } #[test] fn Quat_length2() { let q = Quat::new(3.0, 4.0, 5.0, 6.0); assert_eq!(q.length2(), 86.0); }