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

Function TestValidateBytes

pkg/sql/parser/validate_test.go:48–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestValidateBytes(t *testing.T) {
49 err := parser.ValidateBytes([]byte("SELECT * FROM users WHERE id = 1"))
50 if err != nil {
51 t.Fatalf("ValidateBytes failed: %v", err)
52 }
53
54 err = parser.ValidateBytes([]byte("SELECT FROM WHERE"))
55 if err == nil {
56 t.Fatal("ValidateBytes should fail for invalid SQL")
57 }
58}
59
60func TestParseBytes(t *testing.T) {
61 result, err := parser.ParseBytes([]byte("SELECT * FROM users"))

Callers

nothing calls this directly

Calls 2

ValidateBytesFunction · 0.92
FatalfMethod · 0.65

Tested by

no test coverage detected