Skip to content

PredicateStatus

Oleksandr Bretsko edited this page Dec 27, 2020 · 1 revision

PredicateStatus

PredicateStatus is a trinary that indicates if a Predicate matches a given value or not

public enum PredicateStatus

Initializers

init(bool:)

Converts a boolean to either .matches (if true) or .doesNotMatch (if false).

public init(bool matches: Bool)

init(bool:)

Converts a boolean to either .matches (if true) or .doesNotMatch (if false).

public init(bool matches: Bool)

Enumeration Cases

matches

Matches indicates if the predicate / matcher passes with the given value

case matches

For example, equals(1) returns .matches for expect(1).to(equal(1)).

doesNotMatch

DoesNotMatch indicates if the predicate / matcher fails with the given value, but would succeed if the expectation was inverted.

case doesNotMatch

For example, equals(2) returns .doesNotMatch for expect(1).toNot(equal(2)).

fail

Fail indicates the predicate will never satisfy with the given value in any case. A perfect example is that most matchers fail whenever given nil.

case fail

Using equal(1) fails both expect(nil).to(equal(1)) and expect(nil).toNot(equal(1)). Note: Predicate's requireNonNil property will also provide this feature mostly for free. Your predicate will still need to guard against nils, but error messaging will be handled for you.

matches

Matches indicates if the predicate / matcher passes with the given value

case matches

For example, equals(1) returns .matches for expect(1).to(equal(1)).

doesNotMatch

DoesNotMatch indicates if the predicate / matcher fails with the given value, but would succeed if the expectation was inverted.

case doesNotMatch

For example, equals(2) returns .doesNotMatch for expect(1).toNot(equal(2)).

fail

Fail indicates the predicate will never satisfy with the given value in any case. A perfect example is that most matchers fail whenever given nil.

case fail

Using equal(1) fails both expect(nil).to(equal(1)) and expect(nil).toNot(equal(1)). Note: Predicate's requireNonNil property will also provide this feature mostly for free. Your predicate will still need to guard against nils, but error messaging will be handled for you.

Methods

toObjectiveC()

canImport(Darwin)
public func toObjectiveC() -> NMBPredicateStatus

toObjectiveC()

canImport(Darwin)
public func toObjectiveC() -> NMBPredicateStatus
Types
Protocols
Global Typealiases
Global Variables
Global Functions
  • MACH_MSGH_BITS(_:_:)
  • MACH_MSGH_BITS_REMOTE(_:)
  • QCKMain(_:configurations:testCases:)
  • __allTests()
  • afterEach(_:)
  • afterSuite(_:)
  • allPass(_:)
  • allPass(_:_:)
  • assertClose(_:_:allowedError:file:line:)
  • assertClose(_:_:allowedError:worstError:file:line:)
  • be(_:)
  • beAKindOf(_:)
  • beAnInstanceOf(_:)
  • beCloseTo(_:within:)
  • beEmpty()
  • beFalse()
  • beFalsy()
  • beGreaterThan(_:)
  • beGreaterThanOrEqualTo(_:)
  • beIdenticalTo(_:)
  • beLessThan(_:)
  • beLessThanOrEqualTo(_:)
  • beNil()
  • beTrue()
  • beTruthy()
  • beVoid()
  • beforeEach(_:)
  • beforeSuite(_:)
  • beginWith(_:)
  • catchBadInstruction(block:)
  • catchBadInstruction(in:)
  • chain(_:_:)
  • contain(_:)
  • containElementSatisfying(_:_:)
  • context(_:flags:closure:)
  • crashIf(_:_:)
  • crashIfAnyFalse(_:_:)
  • crashIfAnyFalse(_:crashMessage:)
  • crashIfAnyFalse(_:message:)
  • crashIfAnyNotExpected(_:expected:_:)
  • crashIfAnyNotExpected(_:expected:crashMessage:)
  • crashIfAnyTrue(_:_:)
  • crashIfFalse(_:_:)
  • crashIfNegative(_:)
  • crashIfNil(_:)
  • crashIfNotEqual(_:)
  • crashIfNotEqual(_:_:)
  • crashIfNotExpected(_:expected:_:)
  • crashIfNotNil(_:)
  • describe(_:flags:closure:)
  • doubleForLoop(_:_:)
  • elementsEqual(_:)
  • elementsEqual(_:by:)
  • encode(encodable:)
  • endWith(_:)
  • equal(_:)
  • expect(_:file:line:)
  • expect(_:line:expression:)
  • fail(_:file:line:)
  • fail(_:line:)
  • fail(_:location:)
  • fcontext(_:flags:closure:)
  • fdescribe(_:flags:closure:)
  • fit(_:flags:file:line:closure:)
  • fitBehavesLike(_:flags:file:line:)
  • fitBehavesLike(_:flags:file:line:context:)
  • fitBehavesLike(_:flags:file:line:sharedExampleContext:)
  • gatherExpectations(silently:closure:)
  • gatherFailingExpectations(silently:closure:)
  • haveCount(_:)
  • isValidLength(_:)
  • it(_:flags:file:line:closure:)
  • itBehavesLike(_:flags:file:line:)
  • itBehavesLike(_:flags:file:line:context:)
  • itBehavesLike(_:flags:file:line:sharedExampleContext:)
  • match(_:)
  • matchError(_:)
  • pending(_:closure:)
  • postNotifications(_:fromNotificationCenter:)
  • prettyCollectionType(_:)
  • product(_:_:)
  • raiseException(named:reason:userInfo:closure:)
  • recordFailure(_:location:)
  • satisfyAllOf(_:)
  • satisfyAnyOf(_:)
  • sharedExamples(_:closure:)
  • stringify(_:)
  • succeed()
  • threadSingleton(_:)
  • throwAssertion()
  • throwError()
  • throwError(_:closure:)
  • throwError(closure:)
  • throwError(errorType:closure:)
  • uuid()
  • waitUntil(timeout:file:line:action:)
  • withAssertionHandler(_:file:line:closure:)
  • xcontext(_:flags:closure:)
  • xdescribe(_:flags:closure:)
  • xit(_:flags:file:line:closure:)
  • xitBehavesLike(_:flags:file:line:context:)
Operators
  • !=(lhs:rhs:)
  • !==(lhs:rhs:)
  • &&(left:right:)
  • **(lhs:rhs:)
  • <(lhs:rhs:)
  • <=(lhs:rhs:)
  • ==(lhs:rhs:)
  • ===(lhs:rhs:)
  • >(lhs:rhs:)
  • >=(lhs:rhs:)
  • ||(left:right:)
  • ~=(regex:input:)
  • ±(Float:)
  • ±(double:)
  • ±(lhs:rhs:)
  • √(double:)
  • ≈(lhs:rhs:)

Clone this wiki locally