Added tests for gcd overflow on Int.min

This commit is contained in:
NevinBR authored and GitHub committed 2021-08-31 11:10:40 -04:00
1 parent 67af2fe0d9
commit 89c4e42e48
1 file changed
+4
@@ -34,5 +34,9 @@ final class IntegerUtilitiesGCDTests: XCTestCase {
XCTAssertEqual(gcd(16*315, 11*315), 315)
XCTAssertEqual(gcd(97*67*53*27*8, 83*67*53*9*32), 67*53*9*8)
XCTAssertEqual(gcd(Int.min, 2), 2)
XCTExpectFailure{ gcd(0, Int.min) }
XCTExpectFailure{ gcd(Int.min, 0) }
XCTExpectFailure{ gcd(Int.min, Int.min) }
}
}