| name | debug-reference-tests |
| description | Debug ClickHouse reference test failures (the tests/clickhouse-reference-{ast,format,explain,round-trip} suites). Use when one or more of those reference cases fail and you need to see what this library produced vs. the committed expected output. Maps a failing case to the right diff:* npm script and walks through isolating, diffing, and fixing the cause in the grammar/formatter/explain code. |
Debugging ClickHouse reference test failures
The reference suites in tests/ parse every .sql file in
tests/clickhouse-reference/ and compare this library's output against the
committed expected files. Each suite checks one dimension:
| Test suite | Compares against | Expected file suffix | Diff command |
|---|
clickhouse-reference-ast.test.ts | parse() (meta stripped) | .expected.ast.json | diff:ast |
clickhouse-reference-format.test.ts | format(parse(...)) | .expected.formatted.sql | diff:format |
clickhouse-reference-explain.test.ts | formatExplain(parse(...)) | .expected.explain.txt | diff:explain |
clickhouse-reference-round-trip.test.ts | parse(format(parse(...))) | (none — internal stability) | see note below |
The diff:* scripts reproduce what each suite compares, then print the
actual output, the expected output, and a colored unified diff ().