Skip to content

Consume ASTTransform::Testing::Assertions for static line-alignment pins - #14

Merged
JPDuchesne merged 1 commit into
mainfrom
jpd/consume-testing-assertions
Jul 24, 2026
Merged

Consume ASTTransform::Testing::Assertions for static line-alignment pins#14
JPDuchesne merged 1 commit into
mainfrom
jpd/consume-testing-assertions

Conversation

@JPDuchesne

Copy link
Copy Markdown
Contributor

Summary

Adopts ASTTransform::Testing::Assertions (from ast-transform's new testing namespace) in LineAlignmentTest — the first real consumption of the public test surface.

  • Every dialect fixture (Then, Where, interactions, deferred-When, Cleanup) gains a static assert_line_aligned pin through ASTTransform::Transformation — the exact annotation pipeline the install hook runs — in-process, no subprocess.
  • The Then-citation subprocess test is replaced by its static pin: its runtime half duplicated what BacktraceSourceMappingTest already proves end-to-end.
  • The five remaining subprocess tests stay, because they pin behavior only execution can prove: failure-vs-error counts, test-name row-line embedding, ensure-time Cleanup output, and locals visibility across deferral.

How much simplification did we get?

An honest accounting:

  • Deleted: one subprocess test (~7 lines) whose coverage was redundant.
  • Added: five 3-line static pins (net +23 lines).
  • Real win is not line count: the static checks are in-process and give precise per-statement diagnostics (MISALIGNED <render>: source line N, emitted line M plus a numbered emitted listing) instead of a subprocess transcript to eyeball, and they cover every surviving statement in each fixture rather than the one line each runtime test happens to cite.
  • Coverage boundary worth knowing: assert_line_aligned matches statements by unparsed render, so statements RSpock rewrites (Then expressions -> assertions, interactions -> Mocha calls) or consumes (Where rows) are exempt from the static check. Alignment of the rewritten forms is still proven at runtime by the remaining subprocess tests and BacktraceSourceMappingTest. The helpers and the acceptance layer are complements, not substitutes.

assert_backtrace_lines found no consumer here: it evals compiled source directly and expects a top-level raise, while RSpock fixtures define test classes that only fail under a Minitest run.

Test plan

  • dev test green: 239 tests (was 235), 0 failures.

Made with Cursor

@JPDuchesne
JPDuchesne force-pushed the jpd/consume-testing-assertions branch from 7b9177a to e3db0ff Compare July 24, 2026 15:52
Base automatically changed from jpd/line-aligned-emission to main July 24, 2026 20:23
Each dialect fixture gains an in-process assert_line_aligned check through
the same annotation pipeline the install hook runs. The Then-citation
subprocess test is replaced outright: its runtime half was already pinned
end-to-end by BacktraceSourceMappingTest. The remaining subprocess tests
stay — they pin behavior only execution can prove (failure vs error
counts, test-name embedding, ensure-time Cleanup output, locals
visibility).

Co-authored-by: Cursor <cursoragent@cursor.com>
@JPDuchesne
JPDuchesne force-pushed the jpd/consume-testing-assertions branch from e3db0ff to 2601f6e Compare July 24, 2026 20:26
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@JPDuchesne
JPDuchesne merged commit 482f2a6 into main Jul 24, 2026
3 checks passed
@JPDuchesne
JPDuchesne deleted the jpd/consume-testing-assertions branch July 24, 2026 20:38
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.

2 participants