Skip to content

Commit c91f7e8

Browse files
committed
Merge pull request #24 from grncdr/patch-1
Test array size when adding to array
2 parents 1327f8c + 6c1c39d commit c91f7e8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
"patch": [{"op":"add", "path": "/2", "value": "bar"}],
113113
"expected": ["foo", "sil", "bar"] },
114114

115+
{ "comment": "add item to array at index > length should fail",
116+
"doc": ["foo", "sil"],
117+
"patch": [{"op":"add", "path": "/3", "value": "bar"}],
118+
"error": "index is greater than number of items in array" },
119+
115120
{ "comment": "test against implementation-specific numeric parsing",
116121
"doc": {"1e0": "foo"},
117122
"patch": [{"op": "test", "path": "/1e0", "value": "foo"}],

0 commit comments

Comments
 (0)