(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func testBatchQueueGetWorksAfterClose(t *testing.T) { |
| 74 | bq := newBatchQueue(10) |
| 75 | enqueueBatches := []*writeBatch{ |
| 76 | newWriteBatch(time.Now(), time.Hour*100), |
| 77 | newWriteBatch(time.Now(), time.Hour*100), |
| 78 | } |
| 79 | |
| 80 | for _, batch := range enqueueBatches { |
| 81 | put := bq.Put(batch) |
| 82 | if !put { |
| 83 | t.Fatal("failed to put batch into queue") |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | bq.Close() |
| 88 | |
| 89 | batchesGotten := 0 |
| 90 | for batchesGotten != 2 { |
| 91 | dequeueBatch := bq.Get() |
| 92 | if dequeueBatch == nil { |
| 93 | t.Fatalf("no batch returned from get") |
| 94 | } |
| 95 | batchesGotten++ |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | func TestWriter(t *testing.T) { |
| 100 | tests := []struct { |
nothing calls this directly
no test coverage detected