mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-10 03:10:41 +00:00
Add basic test to Vec2
This commit is contained in:
parent
7f530e34b7
commit
4fe7df220a
16
src/vec.rs
16
src/vec.rs
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user