File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ extension Shrink {
2525 current = bound
2626 end = from
2727
28- leap = ( from / 2 ) - ( bound / 2 )
28+ leap = from - bound
2929 if leap. isNaN {
3030 current = . nan
3131 } else if leap. isInfinite {
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ import Testing
2424 try #require( results. count > 1 )
2525 #expect( results. first == end)
2626 #expect( !results. contains ( start) )
27+
28+ if start > end {
29+ #expect( results. allSatisfy { $0 >= end } )
30+ } else {
31+ #expect( results. allSatisfy { $0 <= end } )
32+ }
2733 }
2834
2935 @Test func testShrinkWithNan( ) throws {
@@ -51,5 +57,9 @@ import Testing
5157
5258 let shrink5 = ( 20 ) . shrink ( within: 1.5 ... 10 )
5359 #expect( shrink5. current == 1.5 )
60+
61+ var shrink6 = ( 10.0 ) . shrink ( towards: 0 )
62+ _ = shrink6. next ( )
63+ #expect( shrink6. current == 5 )
5464 }
5565}
You can’t perform that action at this time.
0 commit comments