You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, implementing "meta-matchers" (matchers that are composed from other matchers, like allPass() and Guanaco'shaveSucceeded() and haveFailed() is made difficult by the fact that matchers could be one of three distinct, unrelated types: Matcher, BasicMatcher, and NonNilBasicMatcher.
It should be easy to define a function that takes a matcher without defining three signatures, like allPass() does:
Yeah, there needs to be some changes to simplify the internals. I think the removal of BasicMatcher and NonNilBasicMatcher would be preferred in some way. There also needs a reinvestigation if the Swift compiler still gives an obscure message when a generic does match optionals. Having the matcher be able to specify that while Nimble's expectation and matcher protocols be ignorant of that detail would be best.
The text was updated successfully, but these errors were encountered:
Breaking Changes:
- `FullMatcherFunc` requires inverting `doesNotMatch`
- Removed `BasicMatcher` and `NonNilBasicMatcher` protocols.
- `MatcherFunc` implements `Matcher` protocol
- `NonNilMatcherFunc` implemented `Matcher` protocol. This also now checks for nil-ness instead of a wrapper.
- Removed `fullMatcherFromBasicMatcher` and `basicMatcherWithFailureMessage`
- Removed most matcher wrappers: `NonNilBasicMatcherWrapper`, `NonNilMatcherWrapper`, `BasicMatcherWrapper`, `FullMatcherWrapper`
Internal Changes:
- Added `expectTo` and `expectToNot` which is most of the internal implementation of `Expectation.to` and `Expectation.toNot`.
- Matchers no longer need to know about wrappers for Objective-C support.
- Removed redundant `allPass` implementations
All the public matchers remain unchanged from the normal consumer
perspective.
I'd like feedback on this PR.
Closes#109.
See the discussion for details: #95 (comment)
Basically, implementing "meta-matchers" (matchers that are composed from other matchers, like
allPass()
and Guanaco'shaveSucceeded()
andhaveFailed()
is made difficult by the fact that matchers could be one of three distinct, unrelated types:Matcher
,BasicMatcher
, andNonNilBasicMatcher
.It should be easy to define a function that takes a matcher without defining three signatures, like
allPass()
does:In the linked discussion, @jeffh elaborates:
The text was updated successfully, but these errors were encountered: