tests
This commit is contained in:
@@ -582,12 +582,12 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn script_swap_moves_crates_simultaneously() {
|
||||
// Swap the crate at (2,0) with the empty cell at (3,0): one ends up empty,
|
||||
// the other holds the crate, applied in a single batch.
|
||||
fn script_shift_rotates_crates() {
|
||||
// Rotate the crate at (2,0) with the empty cell at (3,0) in a two-cell cycle:
|
||||
// crate moves to (3,0), empty moves back to (2,0).
|
||||
let mut game = game_with_object_script(
|
||||
5,
|
||||
"fn tick(dt) { if Queue.length() == 0 { swap([[2, 0, 3, 0]]); } }",
|
||||
"fn tick(dt) { if Queue.length() == 0 { shift([[2, 0], [3, 0]]); } }",
|
||||
);
|
||||
game.tick(Duration::from_millis(16));
|
||||
let b = game.board();
|
||||
|
||||
Reference in New Issue
Block a user