Verifies: SYS-REQ-006 [boundary]
(t *testing.T)
| 490 | |
| 491 | // Verifies: SYS-REQ-006 [boundary] |
| 492 | func TestRemoval6_ArrayEach_EmptyStringElement(t *testing.T) { |
| 493 | // Can Get return ([], String, 0, nil) for an empty string ""? |
| 494 | // Get("\"\"") → internalGet → searchKeys skipped → nextToken → offset 0 |
| 495 | // → getType(data, 0) → data[0]='"' → stringEnd(data[1:]) |
| 496 | // stringEnd on `"` → finds quote at position 0 → returns (1, false) |
| 497 | // So endOffset = 0 + 1 + 1 = 2. NOT 0. |
| 498 | // Get returns offset=2 (the endOffset from internalGet's 4th return). |
| 499 | // Wait — Get returns internalGet's 4th value as `offset`. |
| 500 | // Let me re-check: Get returns (a, b, d, e) where d = endOffset from internalGet. |
| 501 | // For "" at position 0: endOffset from getType = 2, so Get returns offset=2. |
| 502 | |
| 503 | count := 0 |
| 504 | _, err := ArrayEach([]byte(`["","b"]`), func(value []byte, dataType ValueType, offset int, err error) { |
| 505 | count++ |
| 506 | }) |
| 507 | if err != nil { |
| 508 | t.Fatalf("unexpected error: %v", err) |
| 509 | } |
| 510 | if count != 2 { |
| 511 | t.Fatalf("expected 2 callbacks, got %d", count) |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | // Verifies: SYS-REQ-006 [boundary] |
| 516 | func TestRemoval6_ArrayEach_WhitespaceOnlyInput(t *testing.T) { |
nothing calls this directly
no test coverage detected