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

Function TestDecoderStringNull

decode_string_test.go:322–644  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

320 }
321}
322func TestDecoderStringNull(t *testing.T) {
323 testCases := []struct {
324 name string
325 json string
326 expectedResult string
327 err bool
328 errType interface{}
329 resultIsNil bool
330 }{
331 {
332 name: "basic-string",
333 json: `"string"`,
334 expectedResult: "string",
335 err: false,
336 },
337 {
338 name: "string-solidus",
339 json: `"\/"`,
340 expectedResult: "/",
341 err: false,
342 },
343 {
344 name: "basic-string",
345 json: ``,
346 expectedResult: "",
347 err: false,
348 resultIsNil: true,
349 },
350 {
351 name: "basic-string",
352 json: `""`,
353 expectedResult: "",
354 err: false,
355 },
356 {
357 name: "basic-string2",
358 json: `"hello world!"`,
359 expectedResult: "hello world!",
360 err: false,
361 },
362 {
363 name: "escape-control-char",
364 json: `"\n"`,
365 expectedResult: "\n",
366 err: false,
367 },
368 {
369 name: "escape-control-char",
370 json: `"\\n"`,
371 expectedResult: `\n`,
372 err: false,
373 },
374 {
375 name: "escape-control-char",
376 json: `"\t"`,
377 expectedResult: "\t",
378 err: false,
379 },

Callers

nothing calls this directly

Calls 4

InvalidJSONErrorTypeAlias · 0.85
UnmarshalFunction · 0.85
NewDecoderFunction · 0.85
StringNullMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…