Merge pull request #152 from jpsim/add-more-tests-represnting-floatingpoint

Add more tests representing floating point
This commit is contained in:
Norio Nomura 2019-01-09 13:05:01 +09:00 committed by GitHub
commit 92daf94597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -48,6 +48,8 @@ class RepresenterTests: XCTestCase {
XCTAssertEqual(try Node(Double.nan), ".nan")
XCTAssertEqual(try Node(Double(6.8523015e+5)), "6.8523015e+5")
XCTAssertEqual(try Node(Double(6.8523015e-5)), "6.8523015e-5")
XCTAssertEqual(try Node(Double.greatestFiniteMagnitude), "1.79769313486232e+308")
XCTAssertEqual(try Node(Double.leastNormalMagnitude), "2.2250738585072e-308")
}
func testFloat() throws {
@ -56,6 +58,8 @@ class RepresenterTests: XCTestCase {
XCTAssertEqual(try Node(Float.nan), ".nan")
XCTAssertEqual(try Node(Float(6.852301e+5)), "6.852301e+5")
XCTAssertEqual(try Node(Float(6.852301e-5)), "6.852301e-5")
XCTAssertEqual(try Node(Float.greatestFiniteMagnitude), "3.402823e+38")
XCTAssertEqual(try Node(Float.leastNormalMagnitude), "1.175494e-38")
}
func testInteger() throws {