Skip to content

Testing

Wiki Keeper (Grok Bot) edited this page Oct 15, 2026 · 4 revisions

Testing

Wiki hero

cargo test --all-features --locked

Integration tests

Test What it covers
tests/gguf_smoke.rs Synthetic GGUF bytes in memory: magic/metadata parse, stacked expert slices, per-expert tensors, rejects_bad_magic → UnsupportedFormat, expert_out_of_range → ExpertOutOfRange
tests/gguf_limits.rs ParseLimits budgets and HostSizeOverflow / LimitExceeded
tests/gguf_directory_invariants.rs Fail-closed duplicate names, overlapping payloads, past-EOF ranges
tests/checkpoint_api.rs Format-independent Checkpoint / open_checkpoint contract
tests/checkpoint_parity_matrix.rs Cross-format parity fixtures
tests/public_api_surface.rs Public export surface / compat MoE paths
tests/golden_dequant.rs Golden dequant vectors vs llama.cpp (tests/fixtures/golden/)
tests/safetensors_smoke.rs --features safetensors: header parse, manifest, MoE discovery
tests/safetensors_payload.rs Bounded raw payload reads
tests/safetensors_mmap.rs --features safetensors,mmap: borrowed mmap payloads / large shard smoke
tests/mmap_gguf.rs --features mmap: owned↔mmap parity, K-quant dequant, sparse multi-GiB mapping, large GGUF smoke
tests/nonregular_inputs.rs Unix: reject FIFO / socket / device before open
tests/real_gguf.rs Path-gated real-file pilots: #[ignore]d in CI; ENGRAM_GGUF / ENGRAM_MODEL_DIR; ENGRAM_EXPECT_MOE=1; ENGRAM_MOE_SAMPLES

Unit tests

In-module coverage for cursor/layout/limits/checkpoint helpers; safetensors tests in src/safetensors/tests.rs.

Examples

Example Notes
examples/inspect_gguf.rs CLI-style GGUF inspection
examples/inspect_checkpoint.rs Format-agnostic Checkpoint inspection
examples/checkpoint_smoke.rs Requires --features mmap,safetensors (test = true)

Related


Last updated: October 14, 2026 Updated by: Wiki Keeper (Grok Bot) Package tip reference: dbc46cf (main)

Clone this wiki locally