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

Function TestKeywords_IsDMLKeyword

pkg/sql/keywords/keywords_test.go:296–323  ·  view source on GitHub ↗

TestKeywords_IsDMLKeyword tests the IsDMLKeyword method

(t *testing.T)

Source from the content-addressed store, hash-verified

294
295// TestKeywords_IsDMLKeyword tests the IsDMLKeyword method
296func TestKeywords_IsDMLKeyword(t *testing.T) {
297 k := NewKeywords()
298 tests := []struct {
299 word string
300 expected bool
301 }{
302 {"DISTINCT", true},
303 {"ALL", true},
304 {"FETCH", true},
305 {"NEXT", true},
306 {"ROWS", true},
307 {"ONLY", true},
308 {"WITH", true},
309 {"TIES", true},
310 {"NULLS", true},
311 {"FIRST", true},
312 {"LAST", true},
313 {"SELECT", false},
314 {"NOTDML", false},
315 {"", false},
316 }
317
318 for _, tt := range tests {
319 if got := k.IsDMLKeyword(tt.word); got != tt.expected {
320 t.Errorf("IsDMLKeyword(%q) = %v, want %v", tt.word, got, tt.expected)
321 }
322 }
323}
324
325// TestKeywords_GetDMLKeywordType tests the GetDMLKeywordType method
326func TestKeywords_GetDMLKeywordType(t *testing.T) {

Callers

nothing calls this directly

Calls 3

IsDMLKeywordMethod · 0.95
NewKeywordsFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected