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 #39 from johnjaylward/FixNegativeZero

Fix negative zero
This commit is contained in:
Sean Leary 2016-01-30 15:47:06 -06:00
commit 8f16e065c5
2 changed files with 8 additions and 1 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
/bin/
build
.classpath
.project
.settings/

View file

@ -519,7 +519,9 @@ public class JSONObjectTest {
*/ */
@Test @Test
public void stringToValueNumbersTest() { public void stringToValueNumbersTest() {
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 Double!",
JSONObject.stringToValue( "0.2" ) instanceof Double ); JSONObject.stringToValue( "0.2" ) instanceof Double );
assertTrue( "Doubles should be Doubles, even when incorrectly converting floats!", assertTrue( "Doubles should be Doubles, even when incorrectly converting floats!",