(t *testing.T)
| 214 | } |
| 215 | |
| 216 | func TestFileWriterCompareInOut(t *testing.T) { |
| 217 | defer testutil.DisableLogging()() |
| 218 | |
| 219 | tests := []struct { |
| 220 | name string |
| 221 | numRecords int |
| 222 | wait time.Duration |
| 223 | rotate time.Duration |
| 224 | comps []string |
| 225 | }{ |
| 226 | { |
| 227 | name: "year-month-rotation-out.gz", |
| 228 | numRecords: 500, |
| 229 | wait: 1 * time.Millisecond, |
| 230 | rotate: time.Second, |
| 231 | comps: []string{"{{.Year}}", "{{.Month}}", "{{.Rotation}}-out.csv.gz"}, |
| 232 | }, |
| 233 | { |
| 234 | name: "year-month-out.gz", |
| 235 | numRecords: 500, |
| 236 | wait: 0, |
| 237 | rotate: time.Second, |
| 238 | comps: []string{"{{.Year}}", "{{.Month}}", "out.csv.gz"}, |
| 239 | }, |
| 240 | { |
| 241 | name: "year-month-rotation-out.zst", |
| 242 | numRecords: 500, |
| 243 | wait: 1 * time.Millisecond, |
| 244 | rotate: time.Second, |
| 245 | comps: []string{"{{.Year}}", "{{.Month}}", "{{.Rotation}}-out.csv.zst"}, |
| 246 | }, |
| 247 | { |
| 248 | name: "year-month-out.zst", |
| 249 | numRecords: 500, |
| 250 | wait: 0, |
| 251 | rotate: time.Second, |
| 252 | comps: []string{"{{.Year}}", "{{.Month}}", "out.csv.zst"}, |
| 253 | }, |
| 254 | { |
| 255 | name: "disable-rotation", |
| 256 | numRecords: 500, |
| 257 | wait: 0, |
| 258 | rotate: -1, |
| 259 | comps: []string{"disable-rotation.out.csv.zst"}, |
| 260 | }, |
| 261 | { |
| 262 | name: "field0-out.zst", |
| 263 | numRecords: 20, |
| 264 | wait: 1 * time.Millisecond, |
| 265 | rotate: time.Second, |
| 266 | comps: []string{"{{.Field0}}-out.csv.zst"}, |
| 267 | }, |
| 268 | } |
| 269 | for _, tt := range tests { |
| 270 | t.Run(tt.name, testFileWriterCompareInOut(tt.numRecords, tt.wait, tt.rotate, tt.comps...)) |
| 271 | } |
| 272 | } |
| 273 |
nothing calls this directly
no test coverage detected