mirror of
https://github.com/apple/swift-numerics
synced 2026-11-23 04:34:25 +00:00
[BigIntTests] Update the testExample() method
This commit is contained in:
1 parent
1cb69383a5
commit
b39dd05db3
1 file changed
+7
-7
@@ -25,16 +25,16 @@ func fac(_ n: BigInt) -> BigInt {
|
||||
|
||||
final class BigIntTests: XCTestCase {
|
||||
|
||||
func testExample() throws {
|
||||
func testExample() {
|
||||
let bar = BigInt(exactly: -100)
|
||||
XCTAssertNotNil(bar)
|
||||
XCTAssert(bar! < 0)
|
||||
|
||||
XCTAssert(-(bar!) > 0)
|
||||
XCTAssertEqual(-(bar!), BigInt(100))
|
||||
|
||||
if let bar = bar {
|
||||
XCTAssertLessThan(bar, 0)
|
||||
XCTAssertGreaterThan(-bar, 0)
|
||||
XCTAssertEqual(-bar, BigInt(100))
|
||||
}
|
||||
XCTAssertEqual(-BigInt("-1234567890123456789012345678901234567890")!,
|
||||
BigInt("1234567890123456789012345678901234567890")!)
|
||||
+BigInt("+1234567890123456789012345678901234567890")!)
|
||||
}
|
||||
|
||||
func testFloatingConversion() {
|
||||
|
||||
Reference in new issue
Block a user