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

Function TestRemoval1_ArrayEach_LoopExitsOnEmptyArray

dead_code_audit_test.go:15–22  ·  view source on GitHub ↗

============================================================================= REMOVAL 1: `for true` → `for {}` in ArrayEach, Unescape, ObjectEach These are cosmetic changes. We verify exit conditions still work. ============================================================================= Verifies:

(t *testing.T)

Source from the content-addressed store, hash-verified

13
14// Verifies: SYS-REQ-006 [boundary]
15func TestRemoval1_ArrayEach_LoopExitsOnEmptyArray(t *testing.T) {
16 _, err := ArrayEach([]byte(`[]`), func(value []byte, dataType ValueType, offset int, err error) {
17 t.Fatal("callback should not be called for empty array")
18 })
19 if err != nil {
20 t.Fatalf("unexpected error on empty array: %v", err)
21 }
22}
23
24// Verifies: SYS-REQ-006 [boundary]
25func TestRemoval1_ArrayEach_LoopExitsOnSingleElement(t *testing.T) {

Callers

nothing calls this directly

Calls 1

ArrayEachFunction · 0.85

Tested by

no test coverage detected