initial: inventory-list-test v0.1.0 — 12 assertions

Covers engine spike (multi-slot children), add/remove/contains/count
round-trips, Loud-Error paths (no container block, no stack_mode,
stack_mode=stack), renderable-tag toggle via set_tag, and slot-naming
reconstruction from get_children (simulated post-reload state).
This commit is contained in:
Calic
2026-06-13 17:33:18 +02:00
commit 3ae9799d4d
5 changed files with 370 additions and 0 deletions

26
README.md Normal file
View File

@@ -0,0 +1,26 @@
# lib-core.inventory-list-test
Test suite for `lib-core.inventory-list` v0.1.0.
**12 assertions:** 1 engine spike + 11 spec assertions.
| # | Description |
|---|---|
| spike | `engine.entity` supports 3 children on distinct slot names |
| 1 | `add``contains` true |
| 2 | after `add`: `count == 1`, `contents` contains item |
| 3 | two `add`s → `count == 2`, both in `contents`, distinct slot names |
| 4 | `remove``contains` false, `count == 0` |
| 5 | `add` to entity without container block → Loud-Error |
| 6 | `add` entity without `stack_mode` → Loud-Error |
| 7 | `add` item with `stack_mode="stack"` → Loud-Error |
| 8 | `add` to non-container-template entity → Loud-Error |
| 9 | `add` removes item from renderable index |
| 10 | `remove` restores item to renderable index |
| 11 | slot-naming reconstruction from `get_children` (simulated reload) |
**Run:**
```bash
SPOREL_LIBS_DIR=~/Projects/Sporel/sporel-libs SPOREL_CI=1 SPOREL_LOG_STDERR=1 \
./build/Sporel.exe --test-libs=lib-core.inventory-list-test 2>&1 | tail -30
```