compiler tests: positive-control set for declaration parser (16->21). Closes #1130#1133
Merged
Conversation
Contributor
PR DashboardGenerated at: 2026-06-14 17:32:34 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
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
Add a positive-control test set to
mod tests_compiler_rejectsinbootstrap/src/compiler.rs: where the existing negative tests (added in #1123 / variant Q)pin what the declaration parser rejects and drops, these pin what it accepts and lowers.
Pure test additions; no production code changes.
Motivation
After #1123 we have good coverage of rejection/recovery behavior at the declaration level,
but the acceptance side is comparatively under-pinned. A regression that silently stopped
lowering a valid construct (a const, an fn body, a struct) would not be caught by the
negative tests alone. This adds the mirror set so both directions are locked in.
Following the project rule, each test was written by empirically observing the current
behavior first, then asserting it -- the new tests characterize today's behavior, they do
not endorse or prescribe it.
New tests (5)
accepts_multiple_consts-- two consts (A=7,B=9) both lower.accepts_fn_with_body-- a function with a body (id=x) lowers.accepts_mixed_const_and_fn-- a const plus a function both lower.accepts_struct_declaration-- a struct declaration lowers (its name appears in output,no TODO marker emitted).
lowers_only_first_of_two_modules_characterization-- with two modules, only the FIRST islowered (emitted
modulecount == 1; the second module's symbols are absent). This is acharacterization of current behavior, explicitly named as such.
Verification
tests_compiler_rejectscount: 16 -> 21.L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality
claim added.