Skip to content

Commit 89c4e42

Browse files
authored
Added tests for gcd overflow on Int.min
1 parent 67af2fe commit 89c4e42

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tests/IntegerUtilitiesTests/GCDTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,9 @@ final class IntegerUtilitiesGCDTests: XCTestCase {
3434
XCTAssertEqual(gcd(16*315, 11*315), 315)
3535
XCTAssertEqual(gcd(97*67*53*27*8, 83*67*53*9*32), 67*53*9*8)
3636
XCTAssertEqual(gcd(Int.min, 2), 2)
37+
38+
XCTExpectFailure{ gcd(0, Int.min) }
39+
XCTExpectFailure{ gcd(Int.min, 0) }
40+
XCTExpectFailure{ gcd(Int.min, Int.min) }
3741
}
3842
}

0 commit comments

Comments
 (0)