diff --git a/src/test/org/json/junit/JSONPointerTest.java b/src/test/org/json/junit/JSONPointerTest.java index 103c5a8..3818e82 100644 --- a/src/test/org/json/junit/JSONPointerTest.java +++ b/src/test/org/json/junit/JSONPointerTest.java @@ -94,4 +94,14 @@ public class JSONPointerTest { new JSONPointer("key"); } + @Test(expected = JSONPointerException.class) + public void arrayIndexFailure() { + query("/foo/2"); + } + + @Test(expected = JSONPointerException.class) + public void primitiveFailure() { + query("/obj/key/failure"); + } + } diff --git a/src/test/org/json/junit/jsonpointer-testdoc.json b/src/test/org/json/junit/jsonpointer-testdoc.json index 386bdb7..621ce93 100644 --- a/src/test/org/json/junit/jsonpointer-testdoc.json +++ b/src/test/org/json/junit/jsonpointer-testdoc.json @@ -12,5 +12,8 @@ "i\\j": 5, "k\"l": 6, " ": 7, - "m~n": 8 + "m~n": 8, + "obj" : { + "key" : "value" + } } \ No newline at end of file