diff --git a/Tests/ConstraintMathTests.swift b/Tests/ConstraintMathTests.swift index 8c3e4ce..d4c2ecc 100644 --- a/Tests/ConstraintMathTests.swift +++ b/Tests/ConstraintMathTests.swift @@ -15,9 +15,9 @@ final class ConstraintMathTests: XCTestCase { // A window with the bottom below the limit gets a new height. The top stays // fixed. The top is maxY = 20 + 600 = 620. The new height is 620 - 30 = 590. - func testWindowBottomBelowLimitReturnsNewHeight() { + func testWindowBottomBelowLimitReturnsNewHeight() throws { let window = CGRect(x: 0, y: 20, width: 800, height: 600) - let height = ConstraintMath.newHeight(windowCocoa: window, limitY: 30) + let height = try XCTUnwrap(ConstraintMath.newHeight(windowCocoa: window, limitY: 30)) XCTAssertEqual(height, 590, accuracy: 0.001) } @@ -44,10 +44,10 @@ final class ConstraintMathTests: XCTestCase { // The window bottom (-900) is below the limit. The top is -300. // The top is not below (limitY - 100 = -870), so the service corrects the // window. The new height is top - limitY = -300 - (-770) = 470. - func testWindowOnSecondScreenGetsNewHeight() { + func testWindowOnSecondScreenGetsNewHeight() throws { let window = CGRect(x: 0, y: -900, width: 800, height: 600) // top = -300 XCTAssertFalse(ConstraintMath.isIntentionalMoveDown(windowTopCocoa: window.maxY, limitY: -770)) - let height = ConstraintMath.newHeight(windowCocoa: window, limitY: -770) + let height = try XCTUnwrap(ConstraintMath.newHeight(windowCocoa: window, limitY: -770)) XCTAssertEqual(height, 470, accuracy: 0.001) } }