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

Function TestKeyCountArray

parser_error_test.go:126–144  ·  view source on GitHub ↗

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

(t *testing.T)

Source from the content-addressed store, hash-verified

124// Verifies: SYS-REQ-008 [boundary]
125// MCDC SYS-REQ-008: N/A
126func TestKeyCountArray(t *testing.T) {
127 var sb strings.Builder
128 var keys [][]string
129 //build data
130 sb.WriteString("[")
131 for i := 0; i < 128; i++ {
132 fmt.Fprintf(&sb, `{"key":"%d"}`, i)
133 if i < 127 {
134 sb.WriteString(",")
135 }
136 keys = append(keys, []string{fmt.Sprintf("[%d].key", i)})
137 }
138 sb.WriteString("]")
139
140 data := []byte(sb.String())
141 EachKey(data, func(offset int, value []byte, dt ValueType, err error) {
142 return
143 }, keys...)
144}
145
146// check having a bunch of keys in a super deep array
147// Verifies: SYS-REQ-008 [boundary]

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…