#![allow(bad_style)] //! Tests methods to change vectors to other length vectors use hektor::*; #[test] fn Mat2_diagonal() { let m = Mat2::diagonal(1.0, 2.0); assert_eq!( &format!("{:?}", m), "Mat2 { x_axis: (1.0, 0.0), y_axis: (0.0, 2.0) }" ); } #[test] fn Mat3_diagonal() { let m = Mat3::diagonal(1.0, 2.0, 3.0); assert_eq!( &format!("{:?}", m), "Mat3 { x_axis: (1.0, 0.0, 0.0), y_axis: (0.0, 2.0, 0.0), z_axis: (0.0, 0.0, 3.0) }" ); } #[test] fn Mat4_diagonal() { let m = Mat4::diagonal(1.0, 2.0, 3.0, 4.0); assert_eq!( &format!("{:?}", m), "Mat4 { x_axis: (1.0, 0.0, 0.0, 0.0), y_axis: (0.0, 2.0, 0.0, 0.0), z_axis: (0.0, 0.0, 3.0, 0.0), w_axis: (0.0, 0.0, 0.0, 4.0) }" ); }