Reproduces: KI-4 TestSetTopLevelArrayBeyondLength_KI4 documents the open design gap (DEFECT-260727-T7P7): Set on a top-level array-index beyond length returns KeyPathNotFoundError instead of appending. SYS-REQ-110 unconditionally requires append-at-end, but the code's top-level branch explicitly exc
(t *testing.T)
| 2481 | // PASSES (asserts the current behavior) and will need to be updated |
| 2482 | // if the design decision is to extend Set. |
| 2483 | func TestSetTopLevelArrayBeyondLength_KI4(t *testing.T) { |
| 2484 | _, err := Set([]byte(`[1,2,3]`), []byte(`99`), "[5]") |
| 2485 | if err != KeyPathNotFoundError { |
| 2486 | t.Fatalf("KI-4 no longer reproduces: Set([1,2,3], 99, [5]) err = %v, want KeyPathNotFoundError (if this changed, the design gap was resolved — flip KI-4 to fixed)", err) |
| 2487 | } |
| 2488 | } |
| 2489 | |
| 2490 | // Verifies: SYS-REQ-110 [boundary] |
| 2491 | // SYS-REQ-110:boundary:negative |