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

Function TestKeywords_IsCompoundKeyword

pkg/sql/keywords/keywords_test.go:242–264  ·  view source on GitHub ↗

TestKeywords_IsCompoundKeyword tests the IsCompoundKeyword method

(t *testing.T)

Source from the content-addressed store, hash-verified

240
241// TestKeywords_IsCompoundKeyword tests the IsCompoundKeyword method
242func TestKeywords_IsCompoundKeyword(t *testing.T) {
243 k := NewKeywords()
244 tests := []struct {
245 word string
246 expected bool
247 }{
248 {"GROUP BY", true},
249 {"ORDER BY", true},
250 {"LEFT JOIN", true},
251 {"FULL JOIN", true},
252 {"CROSS JOIN", true},
253 {"NATURAL JOIN", true},
254 {"SELECT", false},
255 {"NOTCOMPOUND", false},
256 {"", false},
257 }
258
259 for _, tt := range tests {
260 if got := k.IsCompoundKeyword(tt.word); got != tt.expected {
261 t.Errorf("IsCompoundKeyword(%q) = %v, want %v", tt.word, got, tt.expected)
262 }
263 }
264}
265
266// TestKeywords_GetCompoundKeywordType tests the GetCompoundKeywordType method
267func TestKeywords_GetCompoundKeywordType(t *testing.T) {

Callers

nothing calls this directly

Calls 3

IsCompoundKeywordMethod · 0.95
NewKeywordsFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected