(t *testing.T)
| 118 | if got != tt.want { |
| 119 | t.Errorf("isQueryLogSelfReferential(%q) = %v, want %v", tt.query, got, tt.want) |
| 120 | } |
| 121 | }) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func TestTruncateQuery(t *testing.T) { |
| 126 | short := "SELECT 1" |
| 127 | if truncateQuery(short) != short { |
| 128 | t.Error("Short query should not be truncated") |
| 129 | } |
| 130 | |
| 131 | long := make([]byte, maxQueryLength+100) |
| 132 | for i := range long { |
| 133 | long[i] = 'x' |
| 134 | } |
| 135 | result := truncateQuery(string(long)) |
| 136 | if len(result) != maxQueryLength { |
| 137 | t.Errorf("Expected truncated length %d, got %d", maxQueryLength, len(result)) |
nothing calls this directly
no test coverage detected