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:
commit
fc881e2631
1 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue