test(fuzz): compare an INVALID_DURATION suggestion up to its trailing zeros #294

Merged
abiwab merged 1 commit from fix/fuzz-normalize-duration-suggestion into dev/1.6 2026-11-26 22:08:55 +01:00
Owner

Fuzz format-preserves-meaning … at $.warnings[].data on ~{1.30% h} (seed 2474233830, index 19881), dev/1.6 only: the INVALID_DURATION suggestion added by #277 quotes the source spelling (1.30 h), like its message, and rule 4 trims the zero (1.3 h). The duration is unread either way: a canonicalization, not a change of meaning.

  • fuzz/src/normalize.ts: for INVALID_DURATION only, data.suggestion is compared once its trailing decimal zeros are removed, with the formatter's own rule 4 regex (a fraction's terms and a 1,000 keep theirs). The field is still compared: any other difference counts. Approved by the maintainer before widening normalize.ts.
  • Tests: one in fuzz/tests/normalize.test.ts (zeros only; unit, digits, fraction, 1,000 and other codes still differ) and fuzz/regressions/277-invalid-duration-suggestion.gram (both fail without the rule).
  • No changeset (private workspace).

Checks: 4203 pass / 1 skip / 0 fail, conformance 148/148 and 24/24, typecheck, biome, deprecations:check, audit 127, fuzz 50k (seed 2004502776, 0 signature). Independent of #293 (no overlapping file).

Fuzz `format-preserves-meaning … at $.warnings[].data` on `~{1.30% h}` (seed 2474233830, index 19881), dev/1.6 only: the `INVALID_DURATION` suggestion added by #277 quotes the source spelling (`1.30 h`), like its `message`, and rule 4 trims the zero (`1.3 h`). The duration is unread either way: a canonicalization, not a change of meaning. - `fuzz/src/normalize.ts`: for `INVALID_DURATION` only, `data.suggestion` is compared once its trailing decimal zeros are removed, with the formatter's own rule 4 regex (a fraction's terms and a `1,000` keep theirs). The field is still compared: any other difference counts. Approved by the maintainer before widening `normalize.ts`. - Tests: one in `fuzz/tests/normalize.test.ts` (zeros only; unit, digits, fraction, `1,000` and other codes still differ) and `fuzz/regressions/277-invalid-duration-suggestion.gram` (both fail without the rule). - No changeset (private workspace). Checks: 4203 pass / 1 skip / 0 fail, conformance 148/148 and 24/24, typecheck, biome, deprecations:check, audit 127, fuzz 50k (seed 2004502776, 0 signature). Independent of #293 (no overlapping file).
test(fuzz): compare an INVALID_DURATION suggestion up to its trailing zeros
All checks were successful
CI / Build & Test (pull_request) Successful in 5m19s
5f1cf5ac55
abiwab merged commit abff326c09 into dev/1.6 2026-11-26 22:08:55 +01:00
abiwab deleted branch fix/fuzz-normalize-duration-suggestion 2026-11-26 22:08:55 +01:00
Sign in to join this conversation.
No description provided.