This commit is contained in:
2026-06-21 22:35:35 -05:00
parent 87979ac610
commit a67f3fa8cf
2 changed files with 105 additions and 95 deletions
+4 -4
View File
@@ -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();