Verifies: SYS-REQ-007 [boundary]
(t *testing.T)
| 590 | |
| 591 | // Verifies: SYS-REQ-007 [boundary] |
| 592 | func TestRemoval_ObjectEach_MalformedNoClosingBrace(t *testing.T) { |
| 593 | // `{"a":1` — no closing brace. After parsing "a":1, |
| 594 | // nextToken on remaining data. Get consumes "1", offset moves past it. |
| 595 | // nextToken(data[offset:]) on empty/near-empty → returns -1 → error. |
| 596 | err := ObjectEach([]byte(`{"a":1`), func(key []byte, value []byte, dataType ValueType, offset int) error { |
| 597 | return nil |
| 598 | }) |
| 599 | if err == nil { |
| 600 | t.Fatal("expected error for missing closing brace") |
| 601 | } |
| 602 | t.Logf("Correctly got error: %v", err) |
| 603 | } |
| 604 | |
| 605 | // ============================================================================= |
| 606 | // STRESS: Ensure no infinite loops or panics on pathological inputs |
nothing calls this directly
no test coverage detected