mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
add test
This commit is contained in:
parent
6d829bd741
commit
0e55916865
|
@ -881,6 +881,33 @@ impl<T: FixedWidthUnsignedInteger> Rect<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[test_case]
|
||||
fn test_rect_iter(_gba: &mut crate::Gba) {
|
||||
let rect: Rect<i32> = Rect::new((5_i32, 5_i32).into(), (3_i32, 3_i32).into());
|
||||
assert_eq!(
|
||||
rect.iter().collect::<alloc::vec::Vec<_>>(),
|
||||
&[
|
||||
(5, 5),
|
||||
(6, 5),
|
||||
(7, 5),
|
||||
(8, 5),
|
||||
(5, 6),
|
||||
(6, 6),
|
||||
(7, 6),
|
||||
(8, 6),
|
||||
(5, 7),
|
||||
(6, 7),
|
||||
(7, 7),
|
||||
(8, 7),
|
||||
(5, 8),
|
||||
(6, 8),
|
||||
(7, 8),
|
||||
(8, 8),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
impl<T: Number> Vector2D<T> {
|
||||
pub fn new(x: T, y: T) -> Self {
|
||||
Vector2D { x, y }
|
||||
|
|
Loading…
Reference in a new issue