From 48b390994642e59eb1a461922a646b4c6544693c Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Mon, 1 May 2017 18:02:03 +0200 Subject: [PATCH] Squashed 'tests/json-patch-tests/' changes from 716417e..5405313 5405313 Add tests for replacing the root document (#30) git-subtree-dir: tests/json-patch-tests git-subtree-split: 54053131a31241ecccfffdc79753ff169aa9763c --- tests.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests.json b/tests.json index 3a42eab..48bbd99 100644 --- a/tests.json +++ b/tests.json @@ -55,6 +55,21 @@ "expected": "bar", "disabled": true }, + { "comment": "replace object document with array document?", + "doc": {}, + "patch": [{"op": "add", "path": "", "value": []}], + "expected": [] }, + + { "comment": "replace array document with object document?", + "doc": [], + "patch": [{"op": "add", "path": "", "value": {}}], + "expected": {} }, + + { "comment": "append to root array document?", + "doc": [], + "patch": [{"op": "add", "path": "/-", "value": "hi"}], + "expected": ["hi"] }, + { "comment": "Add, / target", "doc": {}, "patch": [ {"op": "add", "path": "/", "value":1 } ],