Skip to content

Commit

Permalink
Revert "[WASM] Avoid isEqual"
Browse files Browse the repository at this point in the history
This reverts commit 196e013.
  • Loading branch information
ikesyo committed May 12, 2021
1 parent 8b3a614 commit 9462f34
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions Sources/Nimble/Matchers/BeginWith.swift
Expand Up @@ -11,7 +11,6 @@ public func beginWith<S: Sequence>(_ startingElement: S.Element) -> Predicate<S>
}
}

#if !os(WASI)
/// A Nimble matcher that succeeds when the actual collection's first element
/// is equal to the expected object.
public func beginWith(_ startingElement: Any) -> Predicate<NMBOrderedCollection> {
Expand All @@ -28,7 +27,6 @@ public func beginWith(_ startingElement: Any) -> Predicate<NMBOrderedCollection>
return PredicateStatus(bool: collectionValue.isEqual(startingElement))
}
}
#endif

/// A Nimble matcher that succeeds when the actual string contains expected substring
/// where the expected substring's location is zero.
Expand Down
2 changes: 0 additions & 2 deletions Sources/Nimble/Matchers/EndWith.swift
Expand Up @@ -18,7 +18,6 @@ public func endWith<S: Sequence>(_ endingElement: S.Element) -> Predicate<S> whe
}
}

#if !os(WASI)
/// A Nimble matcher that succeeds when the actual collection's last element
/// is equal to the expected object.
public func endWith(_ endingElement: Any) -> Predicate<NMBOrderedCollection> {
Expand All @@ -37,7 +36,6 @@ public func endWith(_ endingElement: Any) -> Predicate<NMBOrderedCollection> {
return PredicateStatus(bool: collectionValue.isEqual(endingElement))
}
}
#endif

/// A Nimble matcher that succeeds when the actual string contains the expected substring
/// where the expected substring's location is the actual string's length minus the
Expand Down
4 changes: 0 additions & 4 deletions Tests/NimbleTests/Matchers/BeginWithTest.swift
Expand Up @@ -15,21 +15,17 @@ final class BeginWithTest: XCTestCase {
expect(("foobar" as NSString).description).to(beginWith("foo"))
expect(("foobar" as NSString).description).toNot(beginWith("oo"))

#if !os(WASI)
expect(["a", "b"] as NSArray).to(beginWith("a"))
expect(["a", "b"] as NSArray).toNot(beginWith("b"))
#endif
}

func testNegativeMatches() {
#if !os(WASI)
failsWithErrorMessageForNil("expected to begin with <b>, got <nil>") {
expect(nil as NSArray?).to(beginWith("b" as NSString))
}
failsWithErrorMessageForNil("expected to not begin with <b>, got <nil>") {
expect(nil as NSArray?).toNot(beginWith("b" as NSString))
}
#endif

failsWithErrorMessage("expected to begin with <2>, got <[1, 2, 3]>") {
expect([1, 2, 3]).to(beginWith(2))
Expand Down
2 changes: 0 additions & 2 deletions Tests/NimbleTests/Matchers/EndWithTest.swift
Expand Up @@ -16,12 +16,10 @@ final class EndWithTest: XCTestCase {
expect(("foobar" as NSString).description).to(endWith("bar"))
expect(("foobar" as NSString).description).toNot(endWith("oo"))

#if !os(WASI)
expect(["a", "b"] as NSArray).to(endWith("b"))
expect(["a", "b"] as NSArray).toNot(endWith("a"))
expect([] as NSArray).toNot(endWith("a"))
expect(["a", "b", "a"] as NSArray).to(endWith("a"))
#endif
}

func testEndWithNegatives() {
Expand Down

0 comments on commit 9462f34

Please sign in to comment.