Cover the fresh-line keyword fallback in the emitter - #14
Merged
Conversation
place_keyword's else branch (a loc-less or displaced rescue/ensure/else keyword opening a fresh line instead of packing) was the emitter's only uncovered line. Pin it with a fully synthetic ensure — the shape RSpock's Cleanup produces. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-authored-by: Cursor <cursoragent@cursor.com>
Emission is a pure function of the fixture, so fragment predicates (assert_includes, index ordering, scan counts, line-index lookups) asserted less than the tests already knew. Every deterministic emission now pins the whole artifact with assert_equal — three source-based container tests turn out to be byte-identical round trips and assert the source itself. Predicates remain only where the subject is genuinely non-exact: error-message fragments, iseq line-table membership, and runtime values. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
place_keyword's fresh-line fallback (layout.place_on_fresh_line) was the only uncovered line in the emitter/layout/renderer/thunk/lowering set — the branch taken when arescue/ensure/elsekeyword has no source line (or its line is already occupied) and must open a fresh line rather than;-pack.defwith a loc-lessensure— the exact shape RSpock's Cleanup transform produces — asserting the keyword lands on its own line and never packs.lib/ast_transform/line_aligned_emitter.rbnow reports zero uncovered lines.Test plan
dev style+dev testgreen (97 tests); coverage check confirms no uncovered lines in the emitter.Made with Cursor