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

Function TestLoadFileToBuffer_EdgeCases

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

Source from the content-addressed store, hash-verified

106}
107
108func TestLoadFileToBuffer_EdgeCases(t *testing.T) {
109 t.Run("Empty file", func(t *testing.T) {
110 b := createNewBuffer()
111 err := loadFileToBuffer("./data/test/empty_file.csv", b)
112 if err != nil {
113 t.Skipf("Empty test file not found: %v", err)
114 return
115 }
116
117 if b.rowLen != 0 {
118 t.Errorf("Expected 0 rows for empty file, got %d", b.rowLen)
119 }
120 })
121
122 t.Run("Single row", func(t *testing.T) {
123 b := createNewBuffer()
124 err := loadFileToBuffer("./data/test/single_row_data.csv", b)
125 if err != nil {
126 t.Skipf("Single row test file not found: %v", err)
127 return
128 }
129
130 if b.rowLen < 1 {
131 t.Errorf("Expected at least 1 row, got %d", b.rowLen)
132 }
133 })
134
135 t.Run("Non-existent file", func(t *testing.T) {
136 b := createNewBuffer()
137 err := loadFileToBuffer("./nonexistent_file_xyz.csv", b)
138 if err == nil {
139 t.Error("Expected error for non-existent file")
140 }
141 })
142}
143
144// ========================================
145// Pipe Loading Tests

Callers

nothing calls this directly

Calls 2

createNewBufferFunction · 0.85
loadFileToBufferFunction · 0.85

Tested by

no test coverage detected