Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Garcia <[email protected]>
  • Loading branch information
Ruben Garcia committed Nov 12, 2021
1 parent 6840463 commit 5e2bbaf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bytestream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ func TestByteStreamConsumer(t *testing.T) {
assert.Equal(t, expected, b.String())
}

//can consume as a string
var s string
if assert.NoError(t, cons.Consume(bytes.NewBufferString(expected), &s)) {
assert.Equal(t, expected, s)
}

// can consume as an UnmarshalBinary
var bu binaryUnmarshalDummy
if assert.NoError(t, cons.Consume(bytes.NewBufferString(expected), &bu)) {
Expand Down Expand Up @@ -202,6 +208,8 @@ func TestBytestreamConsumer_Close(t *testing.T) {
assert.Equal(t, expected, b.String())
assert.EqualValues(t, 0, r.calledClose)
}


}

func TestBytestreamProducer_Close(t *testing.T) {
Expand Down

0 comments on commit 5e2bbaf

Please sign in to comment.