From 737fdb3d822794022f76518f850acfdc7f977837 Mon Sep 17 00:00:00 2001 From: Rafey Ahmad <71697384+glokta1@users.noreply.github.com> Date: Fri, 19 Jan 2024 01:44:34 +0530 Subject: [PATCH] bytes2: Add tests for StringUnsafe and Reset methods (#14940) Signed-off-by: Rafey Ahmad --- go/bytes2/buffer_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go/bytes2/buffer_test.go b/go/bytes2/buffer_test.go index 83cdb346ec9..4b475fab406 100644 --- a/go/bytes2/buffer_test.go +++ b/go/bytes2/buffer_test.go @@ -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) + } }