1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-18 00:10:51 -07:00
This commit is contained in:
John J. Aylward 2018-03-19 09:34:13 -04:00
parent 770cb9c4e5
commit f4201cf318
2 changed files with 15 additions and 1 deletions

View file

@ -62,6 +62,19 @@ public class JSONPointerTest {
assertSame(document.get(""), query("/")); assertSame(document.get(""), query("/"));
} }
@Test
public void queryByEmptyKeySubObject() {
assertSame(document.getJSONObject("obj").getJSONObject(""), query("/obj/"));
}
@Test
public void queryByEmptyKeySubObjectSubOject() {
assertSame(
document.getJSONObject("obj").getJSONObject("").get(""),
query("/obj//")
);
}
@Test @Test
public void slashEscaping() { public void slashEscaping() {
assertSame(document.get("a/b"), query("/a~1b")); assertSame(document.get("a/b"), query("/a~1b"));

View file

@ -19,6 +19,7 @@
"another/key" : [ "another/key" : [
"val" "val"
] ]
} },
"" : { "" : "empty key of an object with an empty key" }
} }
} }