Skip to content

test(roundtrip): pin reparse-equivalence and diagnostic text for the fidelity regressions - #437

Merged
Teakowa merged 1 commit into
mainfrom
fix/428-roundtrip-fidelity
Oct 13, 2026
Merged

Teakowa merged 1 commit into
mainfrom
fix/428-roundtrip-fidelity

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The five roundtrip-fidelity defects were fixed in the audit batch; this change closes the remaining gap against the issue's acceptance criteria by pinning the outcome contract in the regression tests rather than only the individual assertions:

  • Items 1, 4, 5 (rule-name backslash, forward variable reference, opaque settings escapes): now end with assert_emit_round_trip, so the emitted text must reparse to an equivalent program and re-emit to a fixed point — the issue's "reparses to an equal program" criterion.
  • Items 2, 3 (fractional/overflow declaration index, duplicate settings block): the tests now assert the diagnostics name the offending construct (integer index, duplicate 'settings' block) instead of only asserting is_err.
  • Unverified item (declaration names references can't express, e.g. a.b, a % b): recorded as reproduced and rejected — the diagnostic names the unreferenceable name.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p workshop-rs --lib — all green
  • Re-verified on the CLI: Wait-family emit outputs remain clean; 1.9, 4294967296, -1 indexes and a.b/a % b names all fail with malformed: diagnostics; duplicate settings fails with malformed: duplicate 'settings' block
  • git diff --check

Fixes #428

…fidelity regressions

The audit fixes already reject or correct each of the five roundtrip
defects; the tests now prove the issue's completion contract: re-emitted
text reparses to an equivalent program for the escape and forward-
reference cases, and the invalid inputs fail with diagnostics that name
the offending index, declaration name, or duplicate block. The dotted/
percent declaration-name item is recorded as reproduced and rejected.

Fixes #428
@Teakowa
Teakowa merged commit 7a8e5eb into main Oct 13, 2026
5 checks passed
@Teakowa
Teakowa deleted the fix/428-roundtrip-fidelity branch October 13, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roundtrip fidelity: rule-name escapes, declaration indexes, duplicate settings blocks, forward variable references, opaque string escapes

2 participants