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

Function TestValidateSQLInternal_ValidGeneric

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

Source from the content-addressed store, hash-verified

28}
29
30func TestValidateSQLInternal_ValidGeneric(t *testing.T) {
31 data, err := validateSQLInternal("SELECT 1", "")
32 if err != nil {
33 t.Fatalf("unexpected error: %v", err)
34 }
35 if data["valid"] != true {
36 t.Errorf("expected valid=true, got %v", data["valid"])
37 }
38 if _, ok := data["dialect"]; ok {
39 t.Error("generic validation should not include dialect key")
40 }
41}
42
43func TestValidateSQLInternal_InvalidGeneric(t *testing.T) {
44 data, err := validateSQLInternal("SELECT FROM", "")

Callers

nothing calls this directly

Calls 4

validateSQLInternalFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected