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

Function TestKeyDepth

parser_error_test.go:63–78  ·  view source on GitHub ↗

check having a very deep key depth Verifies: SYS-REQ-008 [boundary] MCDC SYS-REQ-008: N/A

(t *testing.T)

Source from the content-addressed store, hash-verified

61// Verifies: SYS-REQ-008 [boundary]
62// MCDC SYS-REQ-008: N/A
63func TestKeyDepth(t *testing.T) {
64 var sb strings.Builder
65 var keys []string
66 //build data
67 sb.WriteString("{")
68 for i := 0; i < 128; i++ {
69 fmt.Fprintf(&sb, `"key%d": %dx,`, i, i)
70 keys = append(keys, fmt.Sprintf("key%d", i))
71 }
72 sb.WriteString("}")
73
74 data := []byte(sb.String())
75 EachKey(data, func(offset int, value []byte, dt ValueType, err error) {
76 return
77 }, keys)
78}
79
80// check having a bunch of keys in a call to EachKey
81// 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…