1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

Merge pull request #82 from billdeng/master

Correct the message to match the function
This commit is contained in:
Sean Leary 2018-02-02 23:56:36 -06:00 committed by GitHub
commit fc881e2631
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,7 +266,7 @@ public class JSONObjectTest {
JSONObject jsonObject = new JSONObject(new MyNumberContainer()); JSONObject jsonObject = new JSONObject(new MyNumberContainer());
String actual = jsonObject.toString(); String actual = jsonObject.toString();
String expected = "{\"myNumber\":{\"number\":42}}"; String expected = "{\"myNumber\":{\"number\":42}}";
assertEquals("Not Equal", expected , actual); assertEquals("Equal", expected , actual);
/** /**
* JSONObject.put() handles objects differently than the * JSONObject.put() handles objects differently than the
@ -280,7 +280,7 @@ public class JSONObjectTest {
jsonObject.put("myNumber", new MyNumber()); jsonObject.put("myNumber", new MyNumber());
actual = jsonObject.toString(); actual = jsonObject.toString();
expected = "{\"myNumber\":42}"; expected = "{\"myNumber\":42}";
assertEquals("Not Equal", expected , actual); assertEquals("Equal", expected , actual);
/** /**
* Calls the JSONObject(Map) ctor, which calls wrap() for values. * Calls the JSONObject(Map) ctor, which calls wrap() for values.
@ -293,7 +293,7 @@ public class JSONObjectTest {
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new AtomicInteger(42))); jsonObject = new JSONObject(Collections.singletonMap("myNumber", new AtomicInteger(42)));
actual = jsonObject.toString(); actual = jsonObject.toString();
expected = "{\"myNumber\":\"42\"}"; expected = "{\"myNumber\":\"42\"}";
assertEquals("Not Equal", expected , actual); assertEquals("Equal", expected , actual);
/** /**
* JSONObject.put() inserts the AtomicInteger directly into the * JSONObject.put() inserts the AtomicInteger directly into the
@ -305,7 +305,7 @@ public class JSONObjectTest {
jsonObject.put("myNumber", new AtomicInteger(42)); jsonObject.put("myNumber", new AtomicInteger(42));
actual = jsonObject.toString(); actual = jsonObject.toString();
expected = "{\"myNumber\":42}"; expected = "{\"myNumber\":42}";
assertEquals("Not Equal", expected , actual); assertEquals("Equal", expected , actual);
/** /**
* Calls the JSONObject(Map) ctor, which calls wrap() for values. * Calls the JSONObject(Map) ctor, which calls wrap() for values.
@ -332,7 +332,7 @@ public class JSONObjectTest {
jsonObject.put("myNumber", new Fraction(4,2)); jsonObject.put("myNumber", new Fraction(4,2));
actual = jsonObject.toString(); actual = jsonObject.toString();
expected = "{\"myNumber\":\"4/2\"}"; // valid JSON, bug fixed expected = "{\"myNumber\":\"4/2\"}"; // valid JSON, bug fixed
assertEquals("Not Equal", expected , actual); assertEquals("Equal", expected , actual);
} }
/** /**