TestKeywords_IsDMLKeyword tests the IsDMLKeyword method
(t *testing.T)
| 294 | |
| 295 | // TestKeywords_IsDMLKeyword tests the IsDMLKeyword method |
| 296 | func 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 |
| 326 | func TestKeywords_GetDMLKeywordType(t *testing.T) { |
nothing calls this directly
no test coverage detected