Test truncateSQL helper
(t *testing.T)
| 479 | |
| 480 | // Test truncateSQL helper |
| 481 | func TestTruncateSQL(t *testing.T) { |
| 482 | shortSQL := "SELECT * FROM users" |
| 483 | if truncated := truncateSQL(shortSQL); truncated != shortSQL { |
| 484 | t.Errorf("Short SQL should not be truncated, got: %s", truncated) |
| 485 | } |
| 486 | |
| 487 | longSQL := strings.Repeat("SELECT * FROM users WHERE active = true AND ", 10) |
| 488 | truncated := truncateSQL(longSQL) |
| 489 | if len(truncated) > 104 { // 100 chars + "..." |
| 490 | t.Errorf("Long SQL should be truncated to max 104 chars, got: %d", len(truncated)) |
| 491 | } |
| 492 | if !strings.HasSuffix(truncated, "...") { |
| 493 | t.Error("Truncated SQL should end with '...'") |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | // Test extractTables helper with various SQL statements |
| 498 | func TestExtractTables_SelectWithJoins(t *testing.T) { |
nothing calls this directly
no test coverage detected