Skip to content

test(compilers/openapi): stop the reproducer table drifting - #359

Open
OmarAlJarrah wants to merge 1 commit into
mainfrom
docs/dangling-drop-fixture-count
Open

test(compilers/openapi): stop the reproducer table drifting#359
OmarAlJarrah wants to merge 1 commit into
mainfrom
docs/dangling-drop-fixture-count

Conversation

@OmarAlJarrah

Copy link
Copy Markdown
Member

Summary

danglingDir's doc comment said the directory holds twelve issue-#14
reproducers. It holds fourteen, and the test's own table names all fourteen:

$ ls testdata/dangling/openapi/*.yaml | wc -l
14

f31-discriminator-empty-name.yaml and f32-ref-noncanonical-escape.yaml are
the 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 it
to 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 a
planted defect in each direction rather than accepted because it went green:

  • Fixture on disk, absent from the table — deleting the f32 row fails with
    f32-ref-noncanonical-escape.yaml is in ../../testdata/dangling/openapi but not in danglingReproducers.
  • Table naming a fixture the directory lacks — adding an f99-ghost.yaml row
    fails 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

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
OmarAlJarrah force-pushed the docs/dangling-drop-fixture-count branch from b18d5bd to b3fdf3d Compare August 9, 2026 03:19
@OmarAlJarrah OmarAlJarrah changed the title test(compilers/openapi): hold the reproducer table to its directory test(compilers/openapi): stop the reproducer table drifting Aug 9, 2026
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.

openapi: the danglingDir comment says twelve reproducers; there are fourteen

1 participant