Skip to content

Commit

Permalink
New test for testsuite.json 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alenkow committed Mar 18, 2024
1 parent a092820 commit 17d7dc7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/test/resources/jsonpatch/testsuite.json
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,49 @@
}
},

{
"comment": "complex combination of operations including moving and copying",
"doc": {
"items": {
"item1": {
"name": "Laptop",
"price": 1200
},
"item2": {
"name": "Smartphone",
"price": 800
}
}
},
"patch": [
{"op": "test", "path": "/items/item1/price", "value": 1200},
{"op": "replace", "path": "/items/item1/price", "value": 1100},
{"op": "add", "path": "/items/item3", "value": {"name": "Tablet", "price": 600}},
{"op": "move", "from": "/items/item2", "path": "/items/item4"},
{"op": "copy", "from": "/items/item3", "path": "/items/item5"}
],
"expected": {
"items": {
"item1": {
"name": "Laptop",
"price": 1100
},
"item3": {
"name": "Tablet",
"price": 600
},
"item4": {
"name": "Smartphone",
"price": 800
},
"item5": {
"name": "Tablet",
"price": 600
}
}
}
},

{
"comment": "tests complete"
}
Expand Down

0 comments on commit 17d7dc7

Please sign in to comment.