1.4 KiB
1.4 KiB
Layered Test Suite Architecture (PR‑8.3)
Overview
- Tests are organized by runtime layer to isolate failures and clarify ownership of behavior.
- Location:
crates/dev/prometeu-layer-tests/tests/
Layers and representative tests
- Bytecode encode/decode
bytecode_encode_decode.rs— round‑trip decoding for edge immediates and structure.
- Verifier
verifier_closure_reject.rs— rejectsCALL_CLOSUREwhen TOS is not a closure.- Rule: verifier tests never run the VM.
- VM execution
vm_exec_valid.rs— executes a tiny valid program; assumes verified input.- Rule: VM tests do not depend on the verifier; they prepare ROM directly.
- GC behavior
gc_collect_unreachable.rs— unrooted closure is reclaimed; rooted one survives.
- Scheduler behavior
scheduler_determinism.rs— deterministic FIFO ordering for same‑tick wakeups.
Running the layered suite
- Run just the layered tests:
cargo test -p prometeu-layer-tests - Run the entire workspace:
cargo test
Separation of concerns
- No cross‑layer assumptions in these tests.
- Verifier tests: no
VirtualMachineexecution. - VM tests: assume pre‑verified bytecode; interact via public VM APIs only.
- GC and Scheduler tests: exercise their public APIs directly, without booting the VM.
DRY helpers
- Shared utilities should live in
crates/dev/prometeu-test-supportwhen needed. The current minimal suite avoids duplication by using tiny local helpers.