// OCHamcrest by Jon Reid, https://qualitycoding.org/ // Copyright 2019 hamcrest.org. See LICENSE.txt #import NS_ASSUME_NONNULL_BEGIN /*! * @abstract Calculates the logical disjunction of multiple matchers. * @discussion Evaluation is shortcut, so subsequent matchers are not called if an earlier matcher * returns NO. */ @interface HCAnyOf : HCBaseMatcher - (instancetype)initWithMatchers:(NSArray> *)matchers NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; @end FOUNDATION_EXPORT id HC_anyOfIn(NSArray *matchers); #ifndef HC_DISABLE_SHORT_SYNTAX /*! * @abstract Creates a matcher that matches when the examined object matches any of the * specified matchers. * @param matchers An array of matchers. Any element that is not a matcher is implicitly wrapped in * an equalTo matcher to check for equality. * @discussion * Example
*
assertThat(\@"myValue", allOf(\@[startsWith(\@"foo"), containsSubstring(\@"Val")]))
* * Name Clash
* In the event of a name clash, #define HC_DISABLE_SHORT_SYNTAX and use the synonym * HC_anyOf instead. */ static inline id anyOfIn(NSArray *matchers) { return HC_anyOfIn(matchers); } #endif FOUNDATION_EXPORT id HC_anyOf(id matchers, ...) NS_REQUIRES_NIL_TERMINATION; #ifndef HC_DISABLE_SHORT_SYNTAX /*! * @abstract Creates a matcher that matches when the examined object matches any of the * specified matchers. * @param matchers... A comma-separated list of matchers ending with nil. Any argument * that is not a matcher is implicitly wrapped in an equalTo matcher to check for equality. * @discussion * Example
*
assertThat(\@"myValue", allOf(startsWith(\@"foo"), containsSubstring(\@"Val"), nil))
* * Name Clash
* In the event of a name clash, #define HC_DISABLE_SHORT_SYNTAX and use the synonym * HC_anyOf instead. */ #define anyOf(matchers...) HC_anyOf(matchers) #endif NS_ASSUME_NONNULL_END