From 78cb84d8dae438ecf642047e7917c453f8259d08 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Mon, 13 Apr 2026 10:22:03 -0600 Subject: [PATCH] test: run mutants under both feature configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-mutants now runs cargo-mutants twice — once with defaults (defmt derives present) and once with --no-default-features (derives absent) — so feature-gated paths are covered in both shapes. Same three equivalent mutants are excluded in both runs. --- justfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 099949a..2c55f04 100644 --- a/justfile +++ b/justfile @@ -67,15 +67,25 @@ test-miri: # mutation testing (requires cargo-mutants). # +# Runs under both feature configurations so that feature-gated paths +# (currently only the defmt::Format derives) are covered in both shapes. # Three mutants are excluded as provably equivalent — swapping the # operator does not change behaviour because a downstream check catches # the resulting case. See the regex strings for the specific sites. -test-mutants: +test-mutants: test-mutants-default test-mutants-no-default + +test-mutants-default: cargo mutants --no-shuffle --test-tool=nextest \ -E 'replace > with >= in Command::from_bytes' \ -E 'replace > with >= in CobsDecoder::feed' \ -E 'replace < with <= in cobs_encode_response' +test-mutants-no-default: + cargo mutants --no-shuffle --test-tool=nextest --no-default-features \ + -E 'replace > with >= in Command::from_bytes' \ + -E 'replace > with >= in CobsDecoder::feed' \ + -E 'replace < with <= in cobs_encode_response' + # format code fmt: cargo fmt