Skip to content

Commit

Permalink
Fix grains test (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
meatball133 authored Oct 13, 2023
1 parent 0141241 commit d41dc65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exercises/practice/grains/Tests/GrainsTests/GrainsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ class GrainsTests: XCTestCase {
XCTAssertEqual(try! Grains.square(64), 9_223_372_036_854_775_808)
}

func testSquare0RaisesAnException() throws {
func testSquare0IsInvalid() throws {
try XCTSkipIf(true && !runAll) // change true to false to run this test
XCTAssertThrowsError(try Grains.square(0)) { error in
XCTAssertEqual(error as? GrainsError, GrainsError.inputTooLow)
}
}

func testNegativeSquareRaisesAnException() throws {
func testNegativeSquareIsInvalid() throws {
try XCTSkipIf(true && !runAll) // change true to false to run this test
XCTAssertThrowsError(try Grains.square(-1)) { error in
XCTAssertEqual(error as? GrainsError, GrainsError.inputTooLow)
}
}

func testSquareGreaterThan64RaisesAnException() throws {
func testSquareGreaterThan64IsInvalid() throws {
try XCTSkipIf(true && !runAll) // change true to false to run this test
XCTAssertThrowsError(try Grains.square(65)) { error in
XCTAssertEqual(error as? GrainsError, GrainsError.inputTooHigh)
Expand Down

0 comments on commit d41dc65

Please sign in to comment.