-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from nls-jajuko/double-id-writer
Use DToA.dtoa() to format ID when data type is double
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/hakunapi-core/src/test/java/fi/nls/hakunapi/core/property/HakunaPropertyWritersTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package fi.nls.hakunapi.core.property; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
|
||
public class HakunaPropertyWritersTest { | ||
|
||
@Test | ||
public void testDoubleAsID() { | ||
|
||
assertEquals("1.7976931348623157E308", HakunaPropertyWriters.doubleAsID(Double.MAX_VALUE)); | ||
assertEquals("9223372036854775807", HakunaPropertyWriters.doubleAsID(Double.valueOf(Long.MAX_VALUE))); | ||
|
||
assertEquals("17263226", HakunaPropertyWriters.doubleAsID(1.7263226E7)); | ||
assertEquals("2010474", HakunaPropertyWriters.doubleAsID(2010474.0)); | ||
} | ||
} |