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

Function TestRemoval1_ObjectEach_LoopExitsOnSingleEntry

dead_code_audit_test.go:72–84  ·  view source on GitHub ↗

Verifies: SYS-REQ-007 [boundary]

(t *testing.T)

Source from the content-addressed store, hash-verified

70
71// Verifies: SYS-REQ-007 [boundary]
72func TestRemoval1_ObjectEach_LoopExitsOnSingleEntry(t *testing.T) {
73 count := 0
74 err := ObjectEach([]byte(`{"a":1}`), func(key []byte, value []byte, dataType ValueType, offset int) error {
75 count++
76 return nil
77 })
78 if err != nil {
79 t.Fatalf("unexpected error: %v", err)
80 }
81 if count != 1 {
82 t.Fatalf("expected 1 callback, got %d", count)
83 }
84}
85
86// =============================================================================
87// REMOVAL 2: `end == -1` guard removed in getType

Callers

nothing calls this directly

Calls 1

ObjectEachFunction · 0.85

Tested by

no test coverage detected