(t *testing.T)
| 409 | } |
| 410 | |
| 411 | func TestAddDRToBuffer(t *testing.T) { |
| 412 | b := createNewBuffer() |
| 413 | b.sep = ',' |
| 414 | |
| 415 | tests := []struct { |
| 416 | name string |
| 417 | line string |
| 418 | wantErr bool |
| 419 | }{ |
| 420 | {"Valid line", "John,30,NYC", false}, |
| 421 | {"Empty line", "", false}, |
| 422 | {"Line with quotes", `"Name","Age","City"`, false}, |
| 423 | } |
| 424 | |
| 425 | for _, tt := range tests { |
| 426 | t.Run(tt.name, func(t *testing.T) { |
| 427 | err := addDRToBuffer(b, tt.line, []int{}, []int{}) |
| 428 | if (err != nil) != tt.wantErr { |
| 429 | t.Errorf("addDRToBuffer() error = %v, wantErr %v", err, tt.wantErr) |
| 430 | } |
| 431 | }) |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | func TestConcurrentCSVParsing(t *testing.T) { |
| 436 | lines := []string{ |
nothing calls this directly
no test coverage detected