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

Function TestCodeMCDC_ObjectEachLoopEntry

mcdc_supplement_test.go:721–733  ·  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

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