MCPcopy
hub / github.com/sqlc-dev/sqlc / parseExec

Function parseExec

internal/endtoend/case_test.go:53–71  ·  view source on GitHub ↗
(t *testing.T, dir string)

Source from the content-addressed store, hash-verified

51}
52
53func parseExec(t *testing.T, dir string) *Exec {
54 t.Helper()
55 path := filepath.Join(dir, "exec.json")
56 if _, err := os.Stat(path); os.IsNotExist(err) {
57 return nil
58 }
59 var e Exec
60 blob, err := os.ReadFile(path)
61 if err != nil {
62 t.Fatalf("%s: %s", path, err)
63 }
64 if err := json.Unmarshal(blob, &e); err != nil {
65 t.Fatalf("%s: %s", path, err)
66 }
67 if e.Command == "" {
68 e.Command = "generate"
69 }
70 return &e
71}
72
73func FindTests(t *testing.T, root, testctx string) []*Testcase {
74 var tcs []*Testcase

Callers 1

FindTestsFunction · 0.85

Calls 1

JoinMethod · 0.45

Tested by

no test coverage detected