MCPcopy Create free account
hub / github.com/francoispqt/gojay / TestEncoderBoolEncodeAPI

Function TestEncoderBoolEncodeAPI

encode_bool_test.go:23–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestEncoderBoolEncodeAPI(t *testing.T) {
24 t.Run("true", func(t *testing.T) {
25 builder := &strings.Builder{}
26 enc := BorrowEncoder(builder)
27 defer enc.Release()
28 err := enc.EncodeBool(true)
29 assert.Nil(t, err, "err must be nil")
30 assert.Equal(t, "true", builder.String(), "string(b) must be equal to 'true'")
31 })
32 t.Run("false", func(t *testing.T) {
33 builder := &strings.Builder{}
34 enc := BorrowEncoder(builder)
35 defer enc.Release()
36 err := enc.EncodeBool(false)
37 assert.Nil(t, err, "err must be nil")
38 assert.Equal(t, "false", builder.String(), "string(b) must be equal to 'false'")
39 })
40}
41
42func TestEncoderBoolErrors(t *testing.T) {
43 t.Run("pool-error", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

BorrowEncoderFunction · 0.85
EncodeBoolMethod · 0.80
ReleaseMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…