Skip to content

Commit 8f16e06

Browse files
committed
Merge pull request #39 from johnjaylward/FixNegativeZero
Fix negative zero
2 parents d3b197b + 974c09b commit 8f16e06

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: .gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/bin/
2+
build
3+
.classpath
4+
.project
5+
.settings/

Diff for: src/test/org/json/junit/JSONObjectTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,9 @@ public void jsonObjectValues() {
519519
*/
520520
@Test
521521
public void stringToValueNumbersTest() {
522-
522+
assertTrue("-0 Should be a Double!",JSONObject.stringToValue("-0") instanceof Double);
523+
assertTrue("-0.0 Should be a Double!",JSONObject.stringToValue("-0.0") instanceof Double);
524+
assertTrue("'-' Should be a String!",JSONObject.stringToValue("-") instanceof String);
523525
assertTrue( "0.2 should be a Double!",
524526
JSONObject.stringToValue( "0.2" ) instanceof Double );
525527
assertTrue( "Doubles should be Doubles, even when incorrectly converting floats!",

0 commit comments

Comments
 (0)