MCPcopy Create free account
hub / github.com/codechenx/FastTableViewer / TestAddDRToBuffer

Function TestAddDRToBuffer

io_test.go:411–433  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

409}
410
411func 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
435func TestConcurrentCSVParsing(t *testing.T) {
436 lines := []string{

Callers

nothing calls this directly

Calls 2

createNewBufferFunction · 0.85
addDRToBufferFunction · 0.85

Tested by

no test coverage detected