MCPcopy
hub / github.com/buger/jsonparser / TestEachKeyArray

Function TestEachKeyArray

parser_error_test.go:149–169  ·  view source on GitHub ↗

check having a bunch of keys in a super deep array Verifies: SYS-REQ-008 [boundary] MCDC SYS-REQ-008: N/A

(t *testing.T)

Source from the content-addressed store, hash-verified

147// Verifies: SYS-REQ-008 [boundary]
148// MCDC SYS-REQ-008: N/A
149func TestEachKeyArray(t *testing.T) {
150 var sb strings.Builder
151 var keys [][]string
152 //build data
153 sb.WriteString(`[`)
154 for i := 0; i < 127; i++ {
155 fmt.Fprintf(&sb, `%d`, i)
156 if i < 127 {
157 sb.WriteString(",")
158 }
159 if i < 32 {
160 keys = append(keys, []string{fmt.Sprintf("[%d]", 128+i)})
161 }
162 }
163 sb.WriteString(`]`)
164
165 data := []byte(sb.String())
166 EachKey(data, func(offset int, value []byte, dt ValueType, err error) {
167 return
168 }, keys...)
169}
170
171// Verifies: SYS-REQ-008 [boundary]
172// MCDC SYS-REQ-008: N/A

Callers

nothing calls this directly

Calls 2

EachKeyFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…