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

Function TestParseBytes

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

Source from the content-addressed store, hash-verified

58}
59
60func TestParseBytes(t *testing.T) {
61 result, err := parser.ParseBytes([]byte("SELECT * FROM users"))
62 if err != nil {
63 t.Fatalf("ParseBytes failed: %v", err)
64 }
65 defer ast.ReleaseAST(result)
66
67 if len(result.Statements) != 1 {
68 t.Fatalf("expected 1 statement, got %d", len(result.Statements))
69 }
70}
71
72func TestParseBytesInvalid(t *testing.T) {
73 _, err := parser.ParseBytes([]byte("SELECT FROM WHERE"))

Callers

nothing calls this directly

Calls 3

ParseBytesFunction · 0.92
ReleaseASTFunction · 0.92
FatalfMethod · 0.65

Tested by

no test coverage detected