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

Fix wasm build #1075

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions Tests/NimbleTests/Matchers/AsyncAllPassTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ private func asyncBeNil<T>() -> AsyncPredicate<T> {
}
}

#if !os(WASI)
final class AsyncAllPassTest: XCTestCase {
func testAllPassArray() async {
await expect([1, 2, 3, 4]).to(allPass { value in
Expand Down Expand Up @@ -132,3 +133,4 @@ final class AsyncAllPassTest: XCTestCase {
}
}
}
#endif
10 changes: 10 additions & 0 deletions Tests/NimbleTests/Matchers/EqualTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,11 @@ final class EqualTest: XCTestCase { // swiftlint:disable:this type_body_length
expect(originalArray) != []

let originalArrayAsync = { () async in originalArray }
#if !os(WASI)
await expect(originalArrayAsync).toEventually(equal(expectedArray))
await expect(originalArrayAsync).toEventuallyNot(equal(expectedArray.reversed()))
await expect(originalArrayAsync).toEventuallyNot(equal([]))
#endif
await expect(originalArrayAsync) == expectedArray
await expect(originalArrayAsync) != expectedArray.reversed()
await expect(originalArrayAsync) != []
Expand Down Expand Up @@ -347,9 +349,11 @@ final class EqualTest: XCTestCase { // swiftlint:disable:this type_body_length
expect(originalArray) != []

let originalArrayAsync = { () async in originalArray }
#if !os(WASI)
await expect(originalArrayAsync).toEventually(equal(expectedArray))
await expect(originalArrayAsync).toEventuallyNot(equal(expectedArray.reversed()))
await expect(originalArrayAsync).toEventuallyNot(equal([]))
#endif
await expect(originalArrayAsync) == expectedArray
await expect(originalArrayAsync) != expectedArray.reversed()
await expect(originalArrayAsync) != []
Expand Down Expand Up @@ -380,9 +384,11 @@ final class EqualTest: XCTestCase { // swiftlint:disable:this type_body_length
expect(originalArray) != []

let originalArrayAsync = { () async in originalArray }
#if !os(WASI)
await expect(originalArrayAsync).toEventually(equal(expectedArray))
await expect(originalArrayAsync).toEventuallyNot(equal(expectedArray.reversed()))
await expect(originalArrayAsync).toEventuallyNot(equal([]))
#endif
await expect(originalArrayAsync) == expectedArray
await expect(originalArrayAsync) != expectedArray.reversed()
await expect(originalArrayAsync) != []
Expand Down Expand Up @@ -413,9 +419,11 @@ final class EqualTest: XCTestCase { // swiftlint:disable:this type_body_length
expect(originalArray) != []

let originalArrayAsync = { () async in originalArray }
#if !os(WASI)
await expect(originalArrayAsync).toEventually(equal(expectedArray))
await expect(originalArrayAsync).toEventuallyNot(equal(expectedArray.reversed()))
await expect(originalArrayAsync).toEventuallyNot(equal([]))
#endif
await expect(originalArrayAsync) == expectedArray
await expect(originalArrayAsync) != expectedArray.reversed()
await expect(originalArrayAsync) != []
Expand Down Expand Up @@ -446,9 +454,11 @@ final class EqualTest: XCTestCase { // swiftlint:disable:this type_body_length
expect(originalArray) != []

let originalArrayAsync = { () async in originalArray }
#if !os(WASI)
await expect(originalArrayAsync).toEventually(equal(expectedArray))
await expect(originalArrayAsync).toEventuallyNot(equal(expectedArray.reversed()))
await expect(originalArrayAsync).toEventuallyNot(equal([]))
#endif
await expect(originalArrayAsync) == expectedArray
await expect(originalArrayAsync) != expectedArray.reversed()
await expect(originalArrayAsync) != []
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/SatisfyAllOfTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ final class SatisfyAllOfTest: XCTestCase {
// which causes runtime crashes when you use `[any AsyncablePredicate<T>]`.
// https://github.com/apple/swift/issues/61403
#if swift(>=5.8.0)
#if !os(WASI)
// MARK: - AsyncPredicate variant
@available(macOS 13.0.0, iOS 16.0.0, tvOS 16.0.0, watchOS 9.0.0, *)
func testAsyncSatisfyAllOf() async {
Expand Down Expand Up @@ -120,7 +121,6 @@ final class SatisfyAllOfTest: XCTestCase {
await expect(true).toNot(beTruthy() && beFalsy())
}

#if !os(WASI)
@available(macOS 13.0.0, iOS 16.0.0, tvOS 16.0.0, watchOS 9.0.0, *)
func testAsyncSatisfyAllOfCachesExpressionBeforePassingToPredicates() async {
// This is not a great example of assertion writing - functions being asserted on in Expressions should not have side effects.
Expand Down
2 changes: 1 addition & 1 deletion Tests/NimbleTests/Matchers/SatisfyAnyOfTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ final class SatisfyAnyOfTest: XCTestCase {
// which causes runtime crashes when you use `[any AsyncablePredicate<T>]`.
// https://github.com/apple/swift/issues/61403
#if swift(>=5.8.0)
#if !os(WASI)
// MARK: - Async Variant
@available(macOS 13.0.0, iOS 16.0.0, tvOS 16.0.0, watchOS 9.0.0, *)
func testAsyncSatisfyAnyOf() async {
Expand Down Expand Up @@ -118,7 +119,6 @@ final class SatisfyAnyOfTest: XCTestCase {
await expect(true).to(beTruthy() || beFalsy() || asyncEqual(true) || asyncEqual(false))
}

#if !os(WASI)
@available(macOS 13.0.0, iOS 16.0.0, tvOS 16.0.0, watchOS 9.0.0, *)
func testAsyncSatisfyAllOfCachesExpressionBeforePassingToPredicates() async {
// This is not a great example of assertion writing - functions being asserted on in Expressions should not have side effects.
Expand Down
Loading