mirror of
https://github.com/apple/swift-numerics
synced 2026-11-24 04:38:11 +00:00
Added tests for gcd overflow on Int.min
This commit is contained in:
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) }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user