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

Function TestCodeMCDC_ObjectEachLoopEntry

mcdc_supplement_test.go:717–729  ·  view source on GitHub ↗

Verifies: SYS-REQ-007 [boundary] Code MC/DC gap: parser.go:1138 ObjectEach offset < len(data) Normal ObjectEach iteration has offset < len(data) TRUE.

(t *testing.T)

Source from the content-addressed store, hash-verified

715// Code MC/DC gap: parser.go:1138 ObjectEach offset < len(data)
716// Normal ObjectEach iteration has offset < len(data) TRUE.
717func TestCodeMCDC_ObjectEachLoopEntry(t *testing.T) {
718 var keys []string
719 err := ObjectEach([]byte(`{"a":1,"b":2}`), func(key []byte, value []byte, dataType ValueType, offset int) error {
720 keys = append(keys, string(key))
721 return nil
722 })
723 if err != nil {
724 t.Fatalf("ObjectEach error: %v", err)
725 }
726 if len(keys) != 2 {
727 t.Fatalf("ObjectEach key count = %d, want 2", len(keys))
728 }
729}
730
731// Verifies: SYS-REQ-035 [boundary]
732// Code MC/DC gap: parser.go:778 Delete space-comma handling

Callers

nothing calls this directly

Calls 1

ObjectEachFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…