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

Function TestCodeMCDC_ArrayEachNoError

mcdc_supplement_test.go:648–661  ·  view source on GitHub ↗

Verifies: SYS-REQ-006 [boundary] Code MC/DC gap: parser.go:1081 ArrayEach e != nil (FALSE branch) Normal iteration where Get returns no error has e == nil.

(t *testing.T)

Source from the content-addressed store, hash-verified

646// Code MC/DC gap: parser.go:1081 ArrayEach e != nil (FALSE branch)
647// Normal iteration where Get returns no error has e == nil.
648func TestCodeMCDC_ArrayEachNoError(t *testing.T) {
649 var gotErr bool
650 _, err := ArrayEach([]byte(`["a","b"]`), func(value []byte, dataType ValueType, offset int, err error) {
651 if err != nil {
652 gotErr = true
653 }
654 })
655 if err != nil {
656 t.Fatalf("ArrayEach error: %v", err)
657 }
658 if gotErr {
659 t.Fatal("ArrayEach callback should not receive error for valid input")
660 }
661}
662
663// Verifies: SYS-REQ-001 [boundary]
664// Code MC/DC gap: parser.go:61 findKeyStart ln > 0 with data[i] == '['

Callers

nothing calls this directly

Calls 1

ArrayEachFunction · 0.85

Tested by

no test coverage detected