Skip to content

Commit

Permalink
add failing test for issue #66
Browse files Browse the repository at this point in the history
  • Loading branch information
KevRiver authored and aybabtme committed Nov 6, 2024
1 parent 43c6769 commit 0b08cd6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ func TestScannerLongLine(t *testing.T) {
}
}

func TestLargePayload(t *testing.T) {

ctx := context.Background()
payload := `{"msg":` + strings.Repeat("a", 1024*1024) + `}` // more than 1mb long json payload
src := strings.NewReader(payload)

opts := DefaultOptions()
opts.timeNow = func() time.Time {
return time.Date(2024, 11, 1, 15, 40, 0, 0, time.UTC)
}

sink := bufsink.NewSizedBufferedSink(1024*1024, nil)
err := Scan(ctx, src, sink, opts)
require.NoError(t, err)
}

func pjson(m proto.Message) string {
o, err := protojson.Marshal(m)
if err != nil {
Expand Down

0 comments on commit 0b08cd6

Please sign in to comment.