Skip to content

Commit

Permalink
Fix tests on Swift 5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Mar 12, 2024
1 parent 13798e6 commit be6bc75
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,16 @@ final class GregorianCalculatorTests: XCTestCase {
wait(for: [awaitExpectation], timeout: 2)
calculator.contextRef.withContext { $0.fulfill(.easterSunday, with: date) }
let calcExpectation = expectation(description: "Waiting for the calculator to return the calculated result")
#if compiler(>=5.10) && hasFeature(StrictConcurrency)
nonisolated(unsafe) var result: HolidayDate?
#else
var result: HolidayDate?
#endif
final class Box: @unchecked Sendable {
var result: HolidayDate?
}
let box = Box()
DispatchQueue.global().async { [calculator] in
result = calculator.easterSunday(forYear: date.year)
box.result = calculator.easterSunday(forYear: date.year)
calcExpectation.fulfill()
}
wait(for: [calcExpectation], timeout: 2)
XCTAssertEqual(result, date)
XCTAssertEqual(box.result, date)
}

// TODO: Figure out how this could work
Expand Down

0 comments on commit be6bc75

Please sign in to comment.