File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,21 @@ infix operator ==> {
13
13
14
14
/// Models implication for properties. That is, the property holds if the first argument is false
15
15
/// (in which case the test case is discarded), or if the given property holds.
16
- public func ==> ( b : Bool , p : Testable ) -> Property {
16
+ public func ==> ( b : Bool , @ autoclosure p : ( ) -> Testable ) -> Property {
17
17
if b {
18
- return p. property ( )
18
+ return p ( ) . property ( )
19
19
}
20
20
return Discard ( ) . property ( )
21
21
}
22
22
23
+ /// Models implication for properties. That is, the property holds if the first argument is false
24
+ /// (in which case the test case is discarded), or if the given property holds.
25
+ public func ==> ( b : Bool , p : ( ) -> Testable ) -> Property {
26
+ if b {
27
+ return p ( ) . property ( )
28
+ }
29
+ return Discard ( ) . property ( )
30
+ }
23
31
24
32
infix operator ==== {
25
33
precedence 140
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class ShrinkSpec : XCTestCase {
35
35
return ( !l. getArray. isEmpty && l. getArray != [ 0 ] ) ==> {
36
36
let ls = self . shrinkArbitrary ( l) . map { $0. getArray }
37
37
return ( ls. filter ( { $0 == [ ] || $0 == [ 0 ] } ) . count >= 1 )
38
- } ( )
38
+ }
39
39
}
40
40
41
41
// This should not hold because eventually you'll get to [0, 0] which gets shrunk from
@@ -44,7 +44,7 @@ class ShrinkSpec : XCTestCase {
44
44
return ( !s. getSet. isEmpty && s. getSet != Set ( [ 0 ] ) ) ==> {
45
45
let ls = self . shrinkArbitrary ( s) . map { $0. getSet }
46
46
return ( ls. filter ( { $0 == [ ] || $0 == [ 0 ] } ) . count >= 1 )
47
- } ( )
47
+ }
48
48
} )
49
49
}
50
50
}
You can’t perform that action at this time.
0 commit comments