10 Commits

Author SHA1 Message Date
Axel Meyer
ff27f3caf6 test(maps): maps_t8 round-trip + maps_t9 byte-determinism
t8 saves a map with cells_material set, verifies the JSON
contains the key, reloads, and reads the flag back. t9 saves
twice with no cells_material content and asserts byte-identity
plus absence of the cells_material key in the output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-01 22:30:24 +02:00
Axel Meyer
52da578e3f test(maps): maps_t2-t7 slot-resolution proofs for cell-tile
Proves that previously-unreachable atlas slots become reachable
via the cell-tile material path: slot 0 isolated (t3), slot 1 end
with correct rotations (t4), slot 4 straight (t5), slot 5
tee_open (t6), slot 8 cross_open (t7).

Upgrades write_test.map.json to schema_version 3 with material
and vertices fields on surface so cell_material_slot + set_vertex
resolve correctly in the tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-01 22:13:36 +02:00
Axel Meyer
b68b1d4fba test(maps): maps_t1 cell-tile material round-trip + guards
Exercises set_cell_material / get_cell_material round-trip on the
write_test fixture, plus bounds rejection and unknown-layer
rejection. Confirms the new public API is wired and the guards
match the existing v3 write-API conventions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-01 21:51:01 +02:00
Axel Meyer
e082a39596 Add save_to_disk round-trip and determinism asserts
Verifies the saved JSON is readable, that two successive saves
produce byte-identical output, and that re-loading the saved file
recovers the same cell values that were written before saving.
Uses engine.module.dir_of to write the round-trip fixture to the
lib maps/ directory (asset sandbox rejects absolute temp paths).
2026-05-24 00:43:31 +02:00
Axel Meyer
e399f6c6f8 Add asserts for set_roof write API
Covers value validation (rejects 2), bounds rejection, and the
basic call paths that set up roof state for the save-roundtrip
test in the next commit.
2026-05-24 00:34:18 +02:00
Axel Meyer
8453b1fc8f Add asserts for set_cell_gid write API
Covers happy-path round-trip, bounds rejection (positive and negative),
unknown-layer rejection, and on-demand layer allocation.
2026-05-24 00:25:12 +02:00
Axel Meyer
1ee19b4b7f Migrate test assertions to atlas tile-record shape; bump to 0.3.0
tile.id is now an integer; the stable string identifier is tile.name.
Updates all tile-record string-id assertions to use .name. Adds
walkable field to stub atlas JSONs so gameplay assertions pass without
the legacy tiles dir. Test bootstrap calls maps.load_textures with
aliases pointing to the test-lib itself as the asset provider. Moves
load_textures calls inline after each set_current (Task 4 and Task 9
blocks) so all tile-record shape and walkability checks use atlas
records throughout. Bumps version to 0.3.0, dep on maps 0.3.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 23:09:14 +02:00
Axel Meyer
c3e9eda702 Add v0.2.0 test assertions, multi-layer fixture, second atlas
Migrates the test-lib content authored alongside lib-core.maps v0.2.0
into its canonical role=test location. Covers packed-u32 GID encode/
decode round-trip, v1 to v2 schema upgrade, schema-v2 validation,
multi-layer load, multi-atlas resolution, per-layer tile lookup with
tile_at backwards-compat, gameplay queries (is_walkable, blocks_walk,
blocks_sight), layer iteration around the entity slot, and v1 JSON
auto-migration on load. 367 assertions total when run via the engine
test-libs harness.

New fixtures: maps/demo_v2.map.json (4x4 multi-layer with roof) and
assets/tiles/walls_tilemap.tilemap.json (second atlas with wall tiles).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 17:54:08 +02:00
Axel Meyer
8ef586f930 feat(maps-test): migrate to test-lib (manifest.lib + run_tests) (Test-Opt Phase 3.1)
Per ADR-0037 Tests-as-Libs Convention.

- manifest.module -> manifest.lib with role: 'test'
- init(ctx) -> M.run_tests(ctx) entry-point export
- No assertion-body change

Repo renamed on Gitea: sporel-module-lib-core.maps-test -> sporel-lib-core.maps-test
Local moved: sporel-modules/lib-core.maps-test/ -> sporel-libs/lib-core/maps-test/
History preserved.
2026-05-16 01:16:30 +02:00
Axel Meyer
c869196a62 feat: P.3.1 reference test-module — lib-core.maps assertions 2026-05-11 02:48:47 +02:00