Skip to content

Commit 43f3f5e

Browse files
author
John J. Aylward
committed
Add another test
1 parent f4201cf commit 43f3f5e

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/test/java/org/json/junit/JSONPointerTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ public void queryByEmptyKeySubObjectSubOject() {
7474
query("/obj//")
7575
);
7676
}
77+
78+
@Test
79+
public void queryByEmptyKeySubObjectValue() {
80+
assertSame(
81+
document.getJSONObject("obj").getJSONObject("").get("subKey"),
82+
query("/obj//subKey")
83+
);
84+
}
7785

7886
@Test
7987
public void slashEscaping() {

src/test/resources/jsonpointer-testdoc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"val"
2121
]
2222
},
23-
"" : { "" : "empty key of an object with an empty key" }
23+
"" : {
24+
"" : "empty key of an object with an empty key",
25+
"subKey" : "Some other value"
26+
}
2427
}
2528
}

0 commit comments

Comments
 (0)