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

Function TestCodeMCDC_EachKeyLoopBound

mcdc_supplement_test.go:758–766  ·  view source on GitHub ↗

Verifies: SYS-REQ-008 [boundary] Code MC/DC gap: parser.go:497 EachKey i < ln Normal EachKey iteration has i < ln TRUE.

(t *testing.T)

Source from the content-addressed store, hash-verified

756// Code MC/DC gap: parser.go:497 EachKey i < ln
757// Normal EachKey iteration has i < ln TRUE.
758func TestCodeMCDC_EachKeyLoopBound(t *testing.T) {
759 var count int
760 EachKey([]byte(`{"a":1,"b":2}`), func(idx int, value []byte, vt ValueType, err error) {
761 count++
762 }, []string{"a"}, []string{"b"})
763 if count != 2 {
764 t.Fatalf("EachKey loop count = %d, want 2", count)
765 }
766}
767
768// =============================================================================
769// Code MC/DC gap closure tests — round 2 (100% target)

Callers

nothing calls this directly

Calls 1

EachKeyFunction · 0.85

Tested by

no test coverage detected