Skip to content

Commit 517680a

Browse files
committed
Support throwAssertion matcher on Linux
1 parent fc3cd1a commit 517680a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let package = Package(
1919
#if os(macOS)
2020
return ["CwlPreconditionTesting", "CwlPosixPreconditionTesting"]
2121
#else
22-
return []
22+
return ["CwlPosixPreconditionTesting"]
2323
#endif
2424
}()
2525
),

Sources/Nimble/Matchers/ThrowAssertion.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import CwlPosixPreconditionTesting
88

99
public func throwAssertion() -> Predicate<Void> {
1010
return Predicate { actualExpression in
11-
#if arch(x86_64) && canImport(Darwin)
11+
#if arch(x86_64)
1212
let message = ExpectationMessage.expectedTo("throw an assertion")
1313

1414
var actualError: Error?
@@ -45,9 +45,9 @@ public func throwAssertion() -> Predicate<Void> {
4545
return PredicateResult(bool: caughtException != nil, message: message)
4646
}
4747
#else
48-
fatalError("The throwAssertion Nimble matcher can only run on x86_64 platforms with " +
49-
"Objective-C (e.g. macOS, iPhone 5s or later simulators). You can silence this error " +
50-
"by placing the test case inside an #if arch(x86_64) or canImport(Darwin) conditional statement")
48+
fatalError("The throwAssertion Nimble matcher can only run on x86_64 platforms." +
49+
"You can silence this error " +
50+
"by placing the test case inside an #if arch(x86_64) conditional statement")
5151
#endif
5252
}
5353
}

Tests/NimbleTests/Matchers/ThrowAssertionTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import XCTest
33
import Nimble
44

5-
#if canImport(Darwin)
5+
#if arch(x86_64)
66

77
private let error: Error = NSError(domain: "test", code: 0, userInfo: nil)
88

0 commit comments

Comments
 (0)