Skip to content

Commit 716417e

Browse files
authored
Merge pull request #33 from norpan/patch-2
Removing nonexistent field or index should fail
2 parents aa68c84 + 6e51de2 commit 716417e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,16 @@
393393
{ "comment": "test with bad array number that has leading zeros",
394394
"doc": ["foo", "bar"],
395395
"patch": [{"op": "test", "path": "/01", "value": "bar"}],
396-
"error": "test op should reject the array value, it has leading zeros" }
396+
"error": "test op should reject the array value, it has leading zeros" },
397+
398+
{ "comment": "Removing nonexistent field",
399+
"doc": {"foo" : "bar"},
400+
"patch": [{"op": "remove", "path": "/baz"}],
401+
"error": "removing a nonexistent field should fail" },
402+
403+
{ "comment": "Removing nonexistent index",
404+
"doc": ["foo", "bar"],
405+
"patch": [{"op": "remove", "path": "/2"}],
406+
"error": "removing a nonexistent index should fail" }
397407

398408
]

0 commit comments

Comments
 (0)