more scripting, objects moving
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user