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

Function TestCodeMCDC_FindKeyStartArrayRoot

mcdc_supplement_test.go:666–674  ·  view source on GitHub ↗

Verifies: SYS-REQ-001 [boundary] Code MC/DC gap: parser.go:61 findKeyStart ln > 0 with data[i] == '[' Drive the branch where data starts with '[' (array root).

(t *testing.T)

Source from the content-addressed store, hash-verified

664// Code MC/DC gap: parser.go:61 findKeyStart ln > 0 with data[i] == '['
665// Drive the branch where data starts with '[' (array root).
666func TestCodeMCDC_FindKeyStartArrayRoot(t *testing.T) {
667 // When data starts with '[', findKeyStart enters the array branch.
668 // This drives data[i] == '[' to TRUE.
669 offset, err := findKeyStart([]byte(`[{"a":1}]`), "a")
670 // The function will try to find key "a" but since it's inside an array,
671 // we expect it to either find the key or return not-found.
672 _ = offset
673 _ = err
674}
675
676// Verifies: SYS-REQ-035 [boundary]
677// Code MC/DC gap: parser.go:800 Delete data[endOffset+tokEnd] == ']'

Callers

nothing calls this directly

Calls 1

findKeyStartFunction · 0.85

Tested by

no test coverage detected