73298a99aa8a105cc82f52810d3b023884acdde8
get_children() returns fresh userdata wrappers on each call; without an __eq metamethod, Lua pointer equality fails between two wrappers of the same engine entity. Use composition.reg_id (a stable property on all composition entities) for same_entity() comparisons in assertions 2b, 3b, 9, 10, 11b.
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 adds → 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:
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
Description
Languages
Lua
100%