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

Function TestKeywords_IsReserved

pkg/sql/keywords/keywords_test.go:46–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func TestKeywords_IsReserved(t *testing.T) {
47 k := New(DialectGeneric, true) // Use generic dialect with case-insensitive matching
48 tests := []struct {
49 word string
50 expected bool
51 }{
52 {"SELECT", true}, // Reserved keyword
53 {"COUNT", true}, // Reserved keyword
54 {"FROM", true}, // Reserved keyword
55 {"select", true}, // Case insensitive
56 {"count", true}, // Case insensitive
57 {"NOTAKEYWORD", false},
58 }
59
60 for _, tt := range tests {
61 if got := k.IsReserved(tt.word); got != tt.expected {
62 t.Errorf("IsReserved(%q) = %v, want %v", tt.word, got, tt.expected)
63 }
64 }
65}
66
67func TestKeywords_GetKeyword(t *testing.T) {
68 k := New(DialectGeneric, true) // Use generic dialect with case-insensitive matching

Callers

nothing calls this directly

Calls 3

IsReservedMethod · 0.80
NewFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected