MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestParseSQLInternal_SingleStatement

Function TestParseSQLInternal_SingleStatement

pkg/mcp/tools_internal_test.go:130–145  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

128}
129
130func TestParseSQLInternal_SingleStatement(t *testing.T) {
131 data, err := parseSQLInternal("SELECT id FROM users")
132 if err != nil {
133 t.Fatalf("unexpected error: %v", err)
134 }
135 if data["statement_count"] != 1 {
136 t.Errorf("expected 1 statement, got %v", data["statement_count"])
137 }
138 types, ok := data["statement_types"].([]string)
139 if !ok {
140 t.Fatal("expected statement_types to be []string")
141 }
142 if len(types) != 1 {
143 t.Errorf("expected 1 type, got %d", len(types))
144 }
145}
146
147func TestParseSQLInternal_MultipleStatements(t *testing.T) {
148 data, err := parseSQLInternal("SELECT 1; INSERT INTO t VALUES (1); DELETE FROM t")

Callers

nothing calls this directly

Calls 3

parseSQLInternalFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected