From b39dd05db31c37db6f8cc4ede786330fd66f94de Mon Sep 17 00:00:00 2001 From: Ben Rimmington Date: Wed, 15 Jan 2020 06:44:41 +0000 Subject: [PATCH] [BigIntTests] Update the testExample() method --- Tests/BigIntTests/BigIntTests.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/BigIntTests/BigIntTests.swift b/Tests/BigIntTests/BigIntTests.swift index 4533cb4..ab3dde1 100644 --- a/Tests/BigIntTests/BigIntTests.swift +++ b/Tests/BigIntTests/BigIntTests.swift @@ -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() {