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

Function TestKeyCount

parser_error_test.go:83–101  ·  view source on GitHub ↗

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

(t *testing.T)

Source from the content-addressed store, hash-verified

81// Verifies: SYS-REQ-008 [boundary]
82// MCDC SYS-REQ-008: N/A
83func TestKeyCount(t *testing.T) {
84 var sb strings.Builder
85 var keys [][]string
86 //build data
87 sb.WriteString("{")
88 for i := 0; i < 128; i++ {
89 fmt.Fprintf(&sb, `"key%d":"%d"`, i, i)
90 if i < 127 {
91 sb.WriteString(",")
92 }
93 keys = append(keys, []string{fmt.Sprintf("key%d", i)})
94 }
95 sb.WriteString("}")
96
97 data := []byte(sb.String())
98 EachKey(data, func(offset int, value []byte, dt ValueType, err error) {
99 return
100 }, keys...)
101}
102
103// try pulling lots of keys out of a big array
104// 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…