TestKeywords_CaseSensitivity tests case-insensitive keyword matching
(t *testing.T)
| 435 | |
| 436 | // TestKeywords_CaseSensitivity tests case-insensitive keyword matching |
| 437 | func TestKeywords_CaseSensitivity(t *testing.T) { |
| 438 | k := New(DialectGeneric, true) |
| 439 | |
| 440 | testCases := []string{ |
| 441 | "SELECT", |
| 442 | "select", |
| 443 | "SeLeCt", |
| 444 | "sElEcT", |
| 445 | } |
| 446 | |
| 447 | for _, word := range testCases { |
| 448 | if !k.IsKeyword(word) { |
| 449 | t.Errorf("IsKeyword(%q) should be true with case-insensitive matching", word) |
| 450 | } |
| 451 | if !k.IsReserved(word) { |
| 452 | t.Errorf("IsReserved(%q) should be true with case-insensitive matching", word) |
| 453 | } |
| 454 | tokenType := k.GetTokenType(word) |
| 455 | if tokenType != models.TokenTypeSelect { |
| 456 | t.Errorf("GetTokenType(%q) = %v, want %v", word, tokenType, models.TokenTypeSelect) |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | // TestKeywords_ReservedForTableAlias tests reserved for table alias functionality |
| 462 | func TestKeywords_ReservedForTableAlias(t *testing.T) { |
nothing calls this directly
no test coverage detected