Skip to content

Commit

Permalink
bytes2: Add tests for StringUnsafe and Reset methods (#14940)
Browse files Browse the repository at this point in the history
Signed-off-by: Rafey Ahmad <[email protected]>
  • Loading branch information
glokta1 authored Jan 18, 2024
1 parent 4c36f2a commit 737fdb3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions go/bytes2/buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ func TestBuffer(t *testing.T) {
if got := b.Len(); got != 5 {
t.Errorf("b.Len(): %d, want 5", got)
}
if got := b.StringUnsafe(); got != want {
t.Errorf("b.StringUnsafe(): %s, want %s", got, want)
}
if b.Reset(); len(b.bytes) != 0 {
t.Errorf("b.Reset(): got %s, want \"\"", b.bytes)
}
}

0 comments on commit 737fdb3

Please sign in to comment.