======================================== Async Loading Tests ========================================
(t *testing.T)
| 191 | // ======================================== |
| 192 | |
| 193 | func 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 | |
| 219 | func TestLoadPipeToBufferAsync(t *testing.T) { |
| 220 | csvData := "Name,Age,City\nJohn,30,NYC\nJane,25,LA\n" |
nothing calls this directly
no test coverage detected