MCPcopy Index your code
hub / github.com/codechenx/FastTableViewer / TestLoadFileToBufferAsync

Function TestLoadFileToBufferAsync

io_test.go:193–217  ·  view source on GitHub ↗

======================================== Async Loading Tests ========================================

(t *testing.T)

Source from the content-addressed store, hash-verified

191// ========================================
192
193func TestLoadFileToBufferAsync(t *testing.T) {
194 b := createNewBuffer()
195 updateChan := make(chan bool, 10)
196 doneChan := make(chan error, 1)
197
198 go loadFileToBufferAsync("./data/test/large_sample.csv", b, updateChan, doneChan)
199
200 select {
201 case <-updateChan:
202 t.Log("Received first update")
203 case err := <-doneChan:
204 if err != nil {
205 t.Skipf("Test file not found: %v", err)
206 }
207 }
208
209 err := <-doneChan
210 if err != nil {
211 t.Skipf("Async load failed: %v", err)
212 }
213
214 if b.rowLen == 0 {
215 t.Error("Expected data to be loaded")
216 }
217}
218
219func TestLoadPipeToBufferAsync(t *testing.T) {
220 csvData := "Name,Age,City\nJohn,30,NYC\nJane,25,LA\n"

Callers

nothing calls this directly

Calls 2

createNewBufferFunction · 0.85
loadFileToBufferAsyncFunction · 0.85

Tested by

no test coverage detected