more scripting, objects moving

This commit is contained in:
2026-06-06 17:36:00 -05:00
parent 8ac6da184c
commit a5f60e22e1
5 changed files with 781 additions and 240 deletions
+11
View File
@@ -866,6 +866,17 @@ content = """
assert!(!b.is_valid());
}
#[test]
fn player_fallback_to_origin_clears_solid_terrain() {
// The '@' char is absent, so the player falls back to (0, 0) — which holds a
// wall. The player wins its cell: the wall is cleared so one-solid-per-cell
// holds (the player is itself solid). The fallback is still reported.
let b = load_board(&player_map(3, "\"@\"", "#..", ""));
assert_eq!((b.player.x, b.player.y), (0, 0));
assert_eq!(b.get(0, 0).1, Archetype::Empty); // wall cleared under the player
assert!(!b.is_valid());
}
/// Minimal valid TOML with a configurable grid, used as a base for dimension tests.
fn minimal_toml(width: usize, height: usize, grid_rows: &[&str]) -> String {
let content = grid_rows.join("\n");