Skip to content

Commit

Permalink
Move @mainactor annotations to class in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
liamnichols committed May 29, 2024
1 parent 91c606f commit ca3ccf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Tests/XCStringsToolTests/FixtureTestCase.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import XCTest

@MainActor
class FixtureTestCase: XCTestCase {
var fixtures: [URL]!

Expand All @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion Tests/XCStringsToolTests/GenerateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ca3ccf1

Please sign in to comment.