// OCHamcrest by Jon Reid, https://qualitycoding.org/ // Copyright 2019 hamcrest.org. See LICENSE.txt #import NS_ASSUME_NONNULL_BEGIN /*! * @abstract Calculates the logical conjunction of multiple matchers. * @discussion Evaluation is shortcut, so subsequent matchers are not called if an earlier matcher * returns NO. */ @interface HCAllOf : HCDiagnosingMatcher - (instancetype)initWithMatchers:(NSArray> *)matchers NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; @end FOUNDATION_EXPORT id HC_allOfIn(NSArray> *matchers); #ifndef HC_DISABLE_SHORT_SYNTAX /*! * @abstract Creates a matcher that matches when the examined object matches all 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", allOfIn(\@[startsWith(\@"my"), containsSubstring(\@"Val")]))
* * Name Clash
* In the event of a name clash, #define HC_DISABLE_SHORT_SYNTAX and use the synonym * HC_allOfIn instead. */ static inline id allOfIn(NSArray *matchers) { return HC_allOfIn(matchers); } #endif FOUNDATION_EXPORT id HC_allOf(id matchers, ...) NS_REQUIRES_NIL_TERMINATION; #ifndef HC_DISABLE_SHORT_SYNTAX /*! * @abstract Creates a matcher that matches when the examined object matches all 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(\@"my"), containsSubstring(\@"Val"), nil))
* * Name Clash
* In the event of a name clash, #define HC_DISABLE_SHORT_SYNTAX and use the synonym * HC_allOf instead. */ #define allOf(matchers...) HC_allOf(matchers) #endif NS_ASSUME_NONNULL_END