mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
fixes test to not depend on key order
This commit is contained in:
parent
a66b97f60b
commit
0b1dbe9369
1 changed files with 3 additions and 4 deletions
|
@ -202,10 +202,9 @@ public class JSONObjectTest {
|
||||||
|
|
||||||
// verify Fraction output
|
// verify Fraction output
|
||||||
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new Fraction(4,2)));
|
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new Fraction(4,2)));
|
||||||
actual = jsonObject.toString();
|
assertEquals("Numerator", BigInteger.valueOf(4) , jsonObject.query("/myNumber/numerator"));
|
||||||
expected = "{\"myNumber\":{\"denominator\":2,\"numerator\":4}}";
|
assertEquals("Denominator", BigInteger.valueOf(2) , jsonObject.query("/myNumber/denominator"));
|
||||||
assertEquals("Not Equal", expected , actual);
|
|
||||||
|
|
||||||
jsonObject = new JSONObject();
|
jsonObject = new JSONObject();
|
||||||
jsonObject.put("myNumber", new Fraction(4,2));
|
jsonObject.put("myNumber", new Fraction(4,2));
|
||||||
actual = jsonObject.toString();
|
actual = jsonObject.toString();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue