Skip to content

Commit

Permalink
Add test for zero size
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Mar 26, 2024
1 parent a4080ce commit a7e03e6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sdk/log/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ func (e *testExporter) ForceFlushN() int {
}

func TestChunker(t *testing.T) {
t.Run("Default", func(t *testing.T) {
exp := newTestExporter(nil)
t.Cleanup(exp.Stop)
c := chunker{Exporter: exp}
const size = 100
c.Export(context.Background(), make([]Record, size))

assert.Equal(t, 1, exp.ExportN())
records := exp.Records()
assert.Len(t, records, 1)
assert.Len(t, records[0], size)
})

t.Run("ForceFlush", func(t *testing.T) {
exp := newTestExporter(nil)
t.Cleanup(exp.Stop)
Expand Down

0 comments on commit a7e03e6

Please sign in to comment.