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

Function TestGetMalformedArrayIndex

deep_spec_test.go:1049–1055  ·  view source on GitHub ↗

Verifies: SYS-REQ-022 [boundary] Malformed array index returns not-found.

(t *testing.T)

Source from the content-addressed store, hash-verified

1047// Verifies: SYS-REQ-022 [boundary]
1048// Malformed array index returns not-found.
1049func TestGetMalformedArrayIndex(t *testing.T) {
1050 data := []byte(`{"arr":[1,2,3]}`)
1051 _, _, _, err := Get(data, "arr", "[abc]")
1052 if err == nil {
1053 t.Fatal("Get with malformed array index should return error")
1054 }
1055}
1056
1057// Verifies: SYS-REQ-023 [boundary]
1058// Out-of-bounds array index returns not-found.

Callers

nothing calls this directly

Calls 1

GetFunction · 0.85

Tested by

no test coverage detected