Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable ThrowAssertion for watchOS to make Nimble compile for watchOS #953

Merged
merged 2 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Sources/Nimble/Matchers/ThrowAssertion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ public func catchBadInstruction(block: @escaping () -> Void) -> BadInstructionEx

public func throwAssertion<Out>() -> Predicate<Out> {
return Predicate { actualExpression in
#if (arch(x86_64) || arch(arm64)) && (canImport(Darwin) || canImport(Glibc))
#if os(watchOS)
fatalError("Nimble currently doesn't support watchOS.")
#elseif (arch(x86_64) || arch(arm64)) && (canImport(Darwin) || canImport(Glibc))
let message = ExpectationMessage.expectedTo("throw an assertion")

var actualError: Error?
let caughtException: BadInstructionException? = catchBadInstruction {
#if os(tvOS)
Expand Down
2 changes: 2 additions & 0 deletions Tests/NimbleTests/Matchers/ThrowAssertionTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Nimble

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

#if !os(watchOS)
final class ThrowAssertionTest: XCTestCase {
func testPositiveMatch() {
#if arch(x86_64) || arch(arm64)
Expand Down Expand Up @@ -75,3 +76,4 @@ final class ThrowAssertionTest: XCTestCase {
#endif
}
}
#endif