Skip to content

Commit 51e95d2

Browse files
author
Mike McCabe
committed
initial
1 parent d876e85 commit 51e95d2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

simplexml_tests.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[
2+
{ "comment": "empty list, empty docs",
3+
"doc": {},
4+
"patch": [],
5+
"expected": {} },
6+
7+
{ "comment": "basic simplexml promotion",
8+
"doc": { "foo":1 },
9+
"patch": [ {"add":"/foo/1", "value":2} ],
10+
"expected": { "foo":[1, 2] } },
11+
12+
{ "comment": "Add 1-length array is equivalent to scalar add",
13+
"doc": { },
14+
"patch": [ {"add":"/foo/0", "value":1} ],
15+
"expected": { "foo":1 } },
16+
17+
{ "comment": "replace as array",
18+
"doc": { "foo":1 },
19+
"patch": [ {"replace":"/foo/0", "value":2} ],
20+
"expected": { "foo":2 } },
21+
22+
{ "comment": "remove penultimate demotes to singleton",
23+
"doc": { "foo":[1, 2] },
24+
"patch": [ {"remove":"/foo/1"} ],
25+
"expected": { "foo":1 } },
26+
27+
{ "comment": "tests complete" }
28+
]

0 commit comments

Comments
 (0)