Skip to content

Commit 66817e7

Browse files
committed
test absent 'from' location for copy and move
rfc6902: The "from" location MUST exist for the operation to be successful.
1 parent 09dee56 commit 66817e7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,21 @@
408408
"patch": [ { "op": "copy", "path": "/-" } ],
409409
"error": "missing 'from' parameter" },
410410

411+
{ "comment": "missing from location to copy",
412+
"doc": { "foo": 1 },
413+
"patch": [ { "op": "copy", "from": "/bar", "path": "/foo" } ],
414+
"error": "missing 'from' location" },
415+
411416
{ "comment": "missing from parameter to move",
412417
"doc": { "foo": 1 },
413418
"patch": [ { "op": "move", "path": "" } ],
414419
"error": "missing 'from' parameter" },
415420

421+
{ "comment": "missing from location to move",
422+
"doc": { "foo": 1 },
423+
"patch": [ { "op": "move", "from": "/bar", "path": "/foo" } ],
424+
"error": "missing 'from' location" },
425+
416426
{ "comment": "duplicate ops",
417427
"doc": { "foo": "bar" },
418428
"patch": [ { "op": "add", "path": "/baz", "value": "qux",

0 commit comments

Comments
 (0)