mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-07 03:06:03 +08:00
Merge pull request #82 from billdeng/master
Correct the message to match the function
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user