From f008f492dec8ba5c17f6ef938d6dca456c54bb22 Mon Sep 17 00:00:00 2001 From: Mark Nottingham Date: Sun, 20 Apr 2025 19:11:18 +1000 Subject: [PATCH] Clarify status of negative indices Fixes #47. --- tests.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests.json b/tests.json index ae1f7f0..b02f6c2 100644 --- a/tests.json +++ b/tests.json @@ -94,9 +94,10 @@ "patch": [{"op": "add", "path": "/bar/8", "value": "5"}], "error": "Out of bounds (upper)" }, - { "doc": {"bar": [1, 2]}, + { "comment": "Negative index is evaluated as a path", + "doc": {"bar": [1, 2]}, "patch": [{"op": "add", "path": "/bar/-1", "value": "5"}], - "error": "Out of bounds (lower)" }, + "error": "Negatives indices aren't valid" }, { "doc": {"foo": 1}, "patch": [{"op": "add", "path": "/bar", "value": true}],