test: mutation testing, block boundary tests, exact-fit decode tests (0.3.2)

Added cargo-mutants with 88 mutants tested, 59 caught, 0 missed. Added
targeted tests for 254-byte block boundary encoding (interop-verified)
and exact-fit/too-small decode buffer sizing for the batch zero path.
111 tests total (was 106).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 4.6 committed 2026-03-31 22:12:40 -06:00
1 parent 777a37d4cd
commit b91fbb2ed9
5 files changed
+86 -20

No files matched your search

+7 -17
View File
@@ -5,29 +5,19 @@ test_tool = "nextest"
# are sufficient to catch mutants. Full proptests run separately via just test-unit.
additional_cargo_test_args = ["-E", "not test(proptests)"]
# Excluded mutants (false positives):
# Excluded mutants (false positives only):
#
# 1. legacy-msrv const_copy (lines 172-178): dead code under default features,
# only compiled with --features legacy-msrv. Tested separately in just test-unit.
# - legacy-msrv const_copy: dead code under default features, only compiled
# with --features legacy-msrv. Tested separately.
#
# 2. usize comparisons `> 0` mutated to `>= 0` or `< 0`: no-ops because usize
# is always >= 0. These are tautological mutations, not real test gaps.
# - usize `> 0` → `>= 0` or `< 0`: tautological on usize (always >= 0).
#
# 3. `< 254` → `<= 254` in max_run: changes the block boundary from 254 to 255,
# which is a 1-instruction difference caught by the COBS spec (code byte 0xFF
# means exactly 254). Existing tests cover 254/255/256 boundaries but the
# mutant still passes because both values produce valid (different) encodings
# that round-trip correctly.
#
# 4. Decode batch bounds check `> dest.len()` → `>= dest.len()`: overly strict
# (rejects exact-fit), not unsound. Caught by proptest but not by unit tests
# in the fast subset.
# - `< 254` → `<= 254` in max_run: both branches yield 254 when remaining
# is exactly 254, so the mutation is a semantic no-op.
exclude_re = [
"replace const_copy with \\(\\)",
"in const_copy",
"replace const_copy with \\(\\)",
"replace > with < in encode",
"replace > with >= in encode",
"replace < with <= in encode",
"replace > with == in decode",
"replace > with >= in decode",
]