MCPcopy Create free account
hub / github.com/buger/jsonparser / TestDecodeSingleUnicodeEscape

Function TestDecodeSingleUnicodeEscape

escape_test.go:76–89  ·  view source on GitHub ↗

Verifies: SYS-REQ-014 [malformed] MCDC SYS-REQ-014: N/A

(t *testing.T)

Source from the content-addressed store, hash-verified

74// Verifies: SYS-REQ-014 [malformed]
75// MCDC SYS-REQ-014: N/A
76func TestDecodeSingleUnicodeEscape(t *testing.T) {
77 for _, test := range singleUnicodeEscapeTests {
78 r, ok := decodeSingleUnicodeEscape([]byte(test.in))
79 isErr := !ok
80
81 if isErr != test.isErr {
82 t.Errorf("decodeSingleUnicodeEscape(%s) returned isErr mismatch: expected %t, obtained %t", test.in, test.isErr, isErr)
83 } else if isErr {
84 continue
85 } else if r != test.out {
86 t.Errorf("decodeSingleUnicodeEscape(%s) returned rune mismatch: expected %x (%c), obtained %x (%c)", test.in, test.out, test.out, r, r)
87 }
88 }
89}
90
91// Verifies: SYS-REQ-014 [malformed]
92// MCDC SYS-REQ-014: N/A

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected