Skip to content

Pin the output of BindNamed, In and Rebind for a corpus of queries, with the v1.4.0 rendering for comparison. - #26

Merged
avgvi merged 1 commit into
masterfrom
test/golden-outputs
Oct 11, 2026
Merged

avgvi merged 1 commit into
masterfrom
test/golden-outputs

Conversation

@avgvi

@avgvi avgvi commented Oct 11, 2026

Copy link
Copy Markdown
Member

golden_corpus_test.go holds 77 realistic queries: 40 named queries rendered through BindNamed for every bind type, 23 In calls and 14 Rebind queries for every bind type. TestGolden renders them and compares the result byte for byte with testdata/golden.txt (239 lines); go test -run TestGolden -update regenerates the file after an intended change, and CONTRIBUTING.md asks for that diff to be reviewed and mentioned in the pull request.

testdata/golden-v1.4.0.txt is the same corpus rendered by upstream v1.4.0 from a scratch module, so diff testdata/golden-v1.4.0.txt testdata/golden.txt lists every output the fork changed on purpose: 125 of 239 lines across 41 cases, all of them documented in the changelog (batch VALUES shapes, casts, colons and ? inside literals, identifiers, comments and dollar quotes, Unicode and digit-initial names, empty slices, ??). The cases that must not change are identical in both files: MySQL \' escapes, LIKE ... ESCAPE '\', the MySQL := assignment and the error texts for adjacent or missing parameters.

Local run with Postgres 16, MySQL 8.4 and SQLite: 241 pass, 2 skip, 0 fail.

@avgvi
avgvi merged commit a2e8869 into master Oct 11, 2026
7 checks passed
@avgvi
avgvi deleted the test/golden-outputs branch October 11, 2026 04:48
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.

1 participant