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

Function TestMySQLKeywordsRecognized

pkg/sql/parser/dialect_test.go:114–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestMySQLKeywordsRecognized(t *testing.T) {
115 // UNSIGNED is a MySQL-specific keyword; tokenizer should recognize it
116 tkz, err := tokenizer.NewWithDialect(keywords.DialectMySQL)
117 if err != nil {
118 t.Fatal(err)
119 }
120
121 tokens, err := tkz.Tokenize([]byte("SELECT UNSIGNED"))
122 if err != nil {
123 t.Fatalf("tokenize failed: %v", err)
124 }
125
126 // Should have at least 2 tokens (SELECT, UNSIGNED)
127 if len(tokens) < 2 {
128 t.Fatalf("expected at least 2 tokens, got %d", len(tokens))
129 }
130}
131
132func TestPostgreSQLKeywordsRecognized(t *testing.T) {
133 tkz, err := tokenizer.NewWithDialect(keywords.DialectPostgreSQL)

Callers

nothing calls this directly

Calls 3

NewWithDialectFunction · 0.92
TokenizeMethod · 0.80
FatalfMethod · 0.65

Tested by

no test coverage detected