Skip to content

Commit bfa8998

Browse files
committed
Name testgen goldens analyze.json so editors highlight them as JSON
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y6XkyWnx7iJFEb8q3AnYps
1 parent 7e0a5f5 commit bfa8998

7 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎internal/engine/clickhouse/testgen/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ whoever reads the output.
6969
## Tests
7070

7171
`testdata/<case>/` holds a `schema.sql`, `query.sql`, an optional
72-
`fixture.sql` and the expected `stdout.txt`. The test skips unless a binary is
72+
`fixture.sql` and the expected `analyze.json`. The test skips unless a binary is
7373
available.
7474

7575
```bash
7676
go run . install
7777
go test .
78-
go test . -update # rewrite every stdout.txt
78+
go test . -update # rewrite every analyze.json
7979
```

internal/engine/clickhouse/testgen/testdata/analyze_params/stdout.txt renamed to internal/engine/clickhouse/testgen/testdata/analyze_params/analyze.json

File renamed without changes.

internal/engine/clickhouse/testgen/testdata/exec/stdout.txt renamed to internal/engine/clickhouse/testgen/testdata/exec/analyze.json

File renamed without changes.

internal/engine/clickhouse/testgen/testdata/expressions/stdout.txt renamed to internal/engine/clickhouse/testgen/testdata/expressions/analyze.json

File renamed without changes.

internal/engine/clickhouse/testgen/testdata/subqueries/stdout.txt renamed to internal/engine/clickhouse/testgen/testdata/subqueries/analyze.json

File renamed without changes.

internal/engine/clickhouse/testgen/testdata/types/stdout.txt renamed to internal/engine/clickhouse/testgen/testdata/types/analyze.json

File renamed without changes.

‎internal/engine/clickhouse/testgen/testgen_test.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"testing"
1010
)
1111

12-
var update = flag.Bool("update", false, "rewrite the expected stdout.txt of every case")
12+
var update = flag.Bool("update", false, "rewrite the expected analyze.json of every case")
1313

1414
// TestAnalyze runs the CLI over each directory under testdata, which holds
1515
// the same files a sqlc analyze case does plus a fixture, and compares the
16-
// output with the committed stdout.txt. It needs the clickhouse binary and
16+
// output with the committed analyze.json. It needs the clickhouse binary and
1717
// skips when none is installed.
1818
func TestAnalyze(t *testing.T) {
1919
if _, err := Locate(); err != nil {
@@ -36,7 +36,7 @@ func TestAnalyze(t *testing.T) {
3636
t.Fatalf("%v\n%s", err, stderr.String())
3737
}
3838

39-
golden := filepath.Join(dir, "stdout.txt")
39+
golden := filepath.Join(dir, "analyze.json")
4040
if *update {
4141
if err := os.WriteFile(golden, stdout.Bytes(), 0o644); err != nil {
4242
t.Fatal(err)

0 commit comments

Comments
 (0)