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
|
||||
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new Fraction(4,2)));
|
||||
actual = jsonObject.toString();
|
||||
expected = "{\"myNumber\":{\"denominator\":2,\"numerator\":4}}";
|
||||
assertEquals("Not Equal", expected , actual);
|
||||
|
||||
assertEquals("Numerator", BigInteger.valueOf(4) , jsonObject.query("/myNumber/numerator"));
|
||||
assertEquals("Denominator", BigInteger.valueOf(2) , jsonObject.query("/myNumber/denominator"));
|
||||
|
||||
jsonObject = new JSONObject();
|
||||
jsonObject.put("myNumber", new Fraction(4,2));
|
||||
actual = jsonObject.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue