Add basic test to Vec2

This commit is contained in:
Alexandre Bury 2016-07-12 21:33:24 -07:00
parent 7f530e34b7
commit 4fe7df220a

View File

@ -249,3 +249,19 @@ impl Mul<usize> for Vec4 {
}
}
}
#[cfg(test)]
mod tests {
use super::Vec2;
#[test]
fn test_from() {
let vi32 = Vec2::from((4i32, 5i32));
let vu32 = Vec2::from((4u32, 5u32));
let vusize = Vec2::from((4usize, 5usize));
let vvec = Vec2::from(Vec2::new(4, 5));
assert_eq!(vi32 - vu32, vusize - vvec);
}
}