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

Function TestEncoderStringNullEmpty2

encode_string_test.go:201–223  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

199}
200
201func TestEncoderStringNullEmpty2(t *testing.T) {
202 var testCases = []struct {
203 name string
204 baseJSON string
205 expectedJSON string
206 }{
207 {
208 name: "basic 1st elem",
209 baseJSON: "[",
210 expectedJSON: `["test"`,
211 },
212 }
213 for _, testCase := range testCases {
214 t.Run("true", func(t *testing.T) {
215 var b strings.Builder
216 var enc = NewEncoder(&b)
217 enc.writeString(testCase.baseJSON)
218 enc.StringNullEmpty("test")
219 enc.Write()
220 assert.Equal(t, testCase.expectedJSON, b.String())
221 })
222 }
223}
224
225func TestEncoderStringNullKeyEmpty(t *testing.T) {
226 var testCases = []struct {

Callers

nothing calls this directly

Calls 5

NewEncoderFunction · 0.85
writeStringMethod · 0.80
StringNullEmptyMethod · 0.80
WriteMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…