Skip to content

Commit 3714df7

Browse files
author
Mike McCabe
committed
Add numeric index parsing tests. Partial fix to #5.
1 parent c5a4a10 commit 3714df7

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
@@ -111,6 +111,16 @@
111111
"patch": [{"op":" add", "path": "/2", "value": "bar"}],
112112
"expected": ["foo", "sil", "bar"] },
113113

114+
{ "comment": "test against implementation-specific numeric parsing",
115+
"doc": {"1e0": "foo"},
116+
"patch": [{"op": "test", "path": "/1e0", "value": "foo"}],
117+
"expected": {"1e0": "foo"} },
118+
119+
{ "comment": "test with bad number should fail",
120+
"doc": ["foo", "bar"],
121+
"patch": [{"op": "test", "path": "/1e0", "value": "bar"}],
122+
"error": "test op shouldn't get array element 1" },
123+
114124
{ "doc": ["foo", "sil"],
115125
"patch": [{"op": "add", "path": "/bar", "value": 42}],
116126
"error": "Object operation on array target" },

0 commit comments

Comments
 (0)