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

Function TestSetTopLevelArrayBeyondLength_KI4

parser_test.go:2483–2488  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2481// PASSES (asserts the current behavior) and will need to be updated
2482// if the design decision is to extend Set.
2483func 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

Callers

nothing calls this directly

Calls 1

SetFunction · 0.85

Tested by

no test coverage detected