From ca3ccf1bd5639916f898d290fa39cf75a9080598 Mon Sep 17 00:00:00 2001 From: Liam Nichols Date: Wed, 29 May 2024 23:47:13 +0200 Subject: [PATCH] Move @MainActor annotations to class in tests --- Tests/XCStringsToolTests/FixtureTestCase.swift | 3 ++- Tests/XCStringsToolTests/GenerateTests.swift | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/XCStringsToolTests/FixtureTestCase.swift b/Tests/XCStringsToolTests/FixtureTestCase.swift index 8ca5659..29c77cd 100644 --- a/Tests/XCStringsToolTests/FixtureTestCase.swift +++ b/Tests/XCStringsToolTests/FixtureTestCase.swift @@ -1,6 +1,7 @@ import Foundation import XCTest +@MainActor class FixtureTestCase: XCTestCase { var fixtures: [URL]! @@ -11,7 +12,7 @@ class FixtureTestCase: XCTestCase { fixtures = try XCTUnwrap(bundle.urls(forResourcesWithExtension: "xcstrings", subdirectory: "__Fixtures__")) } - @MainActor func eachFixture(_ test: (URL) throws -> Void) throws { + func eachFixture(_ test: (URL) throws -> Void) throws { for fileURL in fixtures { try XCTContext.runActivity(named: fileURL.lastPathComponent) { activity in do { diff --git a/Tests/XCStringsToolTests/GenerateTests.swift b/Tests/XCStringsToolTests/GenerateTests.swift index d1350de..393cbcf 100644 --- a/Tests/XCStringsToolTests/GenerateTests.swift +++ b/Tests/XCStringsToolTests/GenerateTests.swift @@ -3,8 +3,9 @@ import SnapshotTesting @testable import xcstrings_tool import XCTest +@MainActor final class GenerateTests: FixtureTestCase { - @MainActor func testGenerate() throws { + func testGenerate() throws { try eachFixture { inputURL in if !inputURL.lastPathComponent.hasPrefix("!") { try snapshot(for: inputURL)