We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a66b97f commit 0b1dbe9Copy full SHA for 0b1dbe9
src/test/java/org/json/junit/JSONObjectTest.java
@@ -202,10 +202,9 @@ public void verifyNumberOutput(){
202
203
// verify Fraction output
204
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new Fraction(4,2)));
205
- actual = jsonObject.toString();
206
- expected = "{\"myNumber\":{\"denominator\":2,\"numerator\":4}}";
207
- assertEquals("Not Equal", expected , actual);
208
-
+ assertEquals("Numerator", BigInteger.valueOf(4) , jsonObject.query("/myNumber/numerator"));
+ assertEquals("Denominator", BigInteger.valueOf(2) , jsonObject.query("/myNumber/denominator"));
+
209
jsonObject = new JSONObject();
210
jsonObject.put("myNumber", new Fraction(4,2));
211
actual = jsonObject.toString();
0 commit comments