Skip to content

Commit 88b5fbb

Browse files
committed
Fix crashes in Xcode 15
1 parent ae3500d commit 88b5fbb

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Tests/AppTests/PackageCollectionControllerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class PackageCollectionControllerTests: AppTestCase {
6161
try await app.test(
6262
.GET,
6363
"foo/collection.json",
64-
afterResponse: { res async throws in
64+
afterResponse: { @MainActor res async throws in
6565
// validation
6666
XCTAssertEqual(res.status, .ok)
6767
let json = try res.content.decode(PackageCollection.self)

Tests/AppTests/PackageCollectionTests.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,13 @@ class PackageCollectionTests: AppTestCase {
370370
keywords: ["key", "word"],
371371
overview: "overview")
372372

373-
// validate
373+
#if compiler(<6)
374+
await MainActor.run { // validate
375+
assertSnapshot(of: res, as: .json(encoder))
376+
}
377+
#else
374378
assertSnapshot(of: res, as: .json(encoder))
379+
#endif
375380
}
376381

377382
func test_generate_from_urls_noResults() async throws {
@@ -467,8 +472,13 @@ class PackageCollectionTests: AppTestCase {
467472
authorName: "Foo",
468473
keywords: ["key", "word"])
469474

470-
// validate
475+
#if compiler(<6)
476+
await MainActor.run { // validate
477+
assertSnapshot(of: res, as: .json(encoder))
478+
}
479+
#else
471480
assertSnapshot(of: res, as: .json(encoder))
481+
#endif
472482
}
473483

474484
func test_generate_for_owner_noResults() async throws {
@@ -768,7 +778,13 @@ class PackageCollectionTests: AppTestCase {
768778

769779
// validate signed collection content
770780
XCTAssertFalse(signedCollection.signature.signature.isEmpty)
781+
#if compiler(<6)
782+
await MainActor.run {
783+
assertSnapshot(of: signedCollection, as: .json(encoder))
784+
}
785+
#else
771786
assertSnapshot(of: signedCollection, as: .json(encoder))
787+
#endif
772788

773789
// validate signature
774790
let validated = try await SignedCollection.validate(signedCollection: signedCollection)

0 commit comments

Comments
 (0)