test(compilers/openapi): stop the reproducer table drifting - #359
Open
OmarAlJarrah wants to merge 1 commit into
Open
test(compilers/openapi): stop the reproducer table drifting#359OmarAlJarrah wants to merge 1 commit into
OmarAlJarrah wants to merge 1 commit into
Conversation
The danglingDir comment said the directory holds twelve issue-#14 reproducers. It holds fourteen -- f31-discriminator-empty-name.yaml and f32-ref-noncanonical-escape.yaml postdate the number -- and the test's own table names all fourteen. A count in a comment beside the list it counts has no way to stay true, so drop it. Dropping the number leaves the drift it came from: the table is hand-maintained, so a fixture copied into the directory and not added to it is compiled by nothing while the suite stays green. Move the table into danglingReproducers() and hold it to the directory in both directions, which is what the comment now points at instead of a count.
OmarAlJarrah
force-pushed
the
docs/dangling-drop-fixture-count
branch
from
August 9, 2026 03:19
b18d5bd to
b3fdf3d
Compare
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
danglingDir's doc comment said the directory holds twelve issue-#14reproducers. It holds fourteen, and the test's own table names all fourteen:
f31-discriminator-empty-name.yamlandf32-ref-noncanonical-escape.yamlarethe two the count predates. The number was true when written and rotted as
fixtures were added.
The count is dropped: a count in a comment beside the list it counts has no way
to stay true, and the table below it is the enumeration.
Dropping the number leaves the drift it came from, though — the table itself is
hand-maintained, so a fixture copied into the directory and not added to the
table is compiled by nothing and the suite stays green while the corpus grows
past it. So the table moves into
danglingReproducers()and a new test holds itto the directory in both directions. That is what the comment now points at
instead of a number.
Test plan
TestDanglingRefs_EveryReproducerIsExercised, confirmed to redden against aplanted defect in each direction rather than accepted because it went green:
f32row fails withf32-ref-noncanonical-escape.yaml is in ../../testdata/dangling/openapi but not in danglingReproducers.f99-ghost.yamlrowfails with
should have 14 item(s), but has 15.Full gate green:
gofmt,go vet ./...,golangci-lint run(0 issues),go build ./...,./scripts/check-coverage.sh(all 4942 statements covered).Closes #314