Merge branch 'master' into fix-similar-check

This commit is contained in:
stleary
2021-07-26 17:53:20 -05:00
6 changed files with 40 additions and 21 deletions

View File

@@ -131,6 +131,9 @@ public class JSONObjectTest {
assertTrue("obj1-obj4 Should eval to true", obj1.similar(obj4));
assertFalse("obj1-obj5 Should eval to false", obj1.similar(obj5));
// verify that a double and big decimal are "similar"
assertTrue("should eval to true",new JSONObject().put("a",1.1d).similar(new JSONObject("{\"a\":1.1}")));
}
@Test
@@ -945,7 +948,7 @@ public class JSONObjectTest {
assertTrue("-0 Should be a Double!",JSONObject.stringToValue("-0") instanceof Double);
assertTrue("-0.0 Should be a Double!",JSONObject.stringToValue("-0.0") instanceof Double);
assertTrue("'-' Should be a String!",JSONObject.stringToValue("-") instanceof String);
assertTrue( "0.2 should be a Double!",
assertTrue( "0.2 should be a BigDecimal!",
JSONObject.stringToValue( "0.2" ) instanceof BigDecimal );
assertTrue( "Doubles should be BigDecimal, even when incorrectly converting floats!",
JSONObject.stringToValue( new Double( "0.2f" ).toString() ) instanceof BigDecimal );

View File

@@ -120,7 +120,7 @@ public class JSONPointerTest {
/**
* We pass backslashes as-is
*
* @see https://tools.ietf.org/html/rfc6901#section-3
* @see <a href="https://tools.ietf.org/html/rfc6901#section-3">rfc6901 section 3</a>
*/
@Test
public void backslashHandling() {
@@ -130,7 +130,7 @@ public class JSONPointerTest {
/**
* We pass quotations as-is
*
* @see https://tools.ietf.org/html/rfc6901#section-3
* @see <a href="https://tools.ietf.org/html/rfc6901#section-3">rfc6901 section 3</a>
*/
@Test
public void quotationHandling() {

View File

@@ -8,7 +8,7 @@ import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
/**
* Object for testing the exception handling in {@link JSONObject#populateMap}.
* Object for testing the exception handling in {@link org.json.JSONObject#populateMap}.
*
* @author John Aylward
*/