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
It would be great to be able to call a method instead of using the custom '<-' operator. This would enable adoption in codebases that strongly discourages the use of custom operators.
/// Binds a Testable value to a property.
public func <- (checker : AssertiveQuickCheck, test : @autoclosure @escaping () -> Testable) {
handleQuickCheckWithResult(checker: checker, test: test)
}
public func handleQuickCheckWithResult(checker : AssertiveQuickCheck, test : @autoclosure @escaping () -> Testable) {
switch quickCheckWithResult(checker.args, test()) {
case let .failure(_, _, seed, sz, reason, _, _):
XCTFail(reason + "; Replay with \(seed) and size \(sz)", file: checker.file, line: checker.line)
case let .noExpectedFailure(_, seed, sz, _, _):
XCTFail("Expected property to fail but it didn't. Replay with \(seed) and size \(sz)", file: checker.file, line: checker.line)
case let .insufficientCoverage(_, seed, sz, _, _):
XCTFail("Property coverage insufficient. Replay with \(seed) and size \(sz)", file: checker.file, line: checker.line)
default: ()
}
}
It would be great to be able to call a method instead of using the custom '<-' operator. This would enable adoption in codebases that strongly discourages the use of custom operators.
Check.swift:162
Since the switch statement is on quickCheckWithResult(...), handleQuickCheckWithResult(...) seems like an appropriate name.
The text was updated successfully, but these errors were encountered: