Add rotation unit tests
This commit is contained in:
26
src/card.rs
26
src/card.rs
@@ -714,11 +714,33 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rotate_clockwise() {
|
fn rotate_clockwise() {
|
||||||
todo!();
|
let shape = Card {
|
||||||
|
cells: NW_TRIANGLE,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
let expected = Card {
|
||||||
|
cells: NE_TRIANGLE,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
let result = shape.rotate(RotationDir::Clockwise);
|
||||||
|
assert_eq!(result, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rotate_counter_clockwise() {
|
fn rotate_counter_clockwise() {
|
||||||
todo!();
|
let shape = Card {
|
||||||
|
cells: NE_TRIANGLE,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
let expected = Card {
|
||||||
|
cells: NW_TRIANGLE,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
let result = shape.rotate(RotationDir::CounterClockwise);
|
||||||
|
assert_eq!(result, expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user