Skip to content

Commit

Permalink
test(writer): cover Reset and String
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Jan 12, 2022
1 parent 4b65b2d commit 82924fe
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions w_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package jx

import (
"testing"

"github.com/stretchr/testify/require"
)

func TestWriter_Reset(t *testing.T) {
var w Writer
w.True()
require.NotEmpty(t, w.Buf)
w.Reset()
require.Empty(t, w.Buf)
}

func TestWriter_String(t *testing.T) {
w := Writer{Buf: []byte(`true`)}
require.Equal(t, "true", w.String())
}

0 comments on commit 82924fe

Please sign in to comment.