@@ -99,21 +99,19 @@ module Property =
9999 //
100100
101101 let rec private takeSmallest
102- ( renderRecheck : bool )
103- ( size : Size )
104- ( seed : Seed )
102+ ( args : PropertyArgs )
105103 ( Node (( journal , x ), xs ) : Tree < Journal * Outcome < 'a >>)
106104 ( nshrinks : int < shrinks >)
107105 ( shrinkLimit : int < shrinks > Option ) : Status =
108106 let failed =
109107 Failed {
110- Size = size
111- Seed = seed
108+ Size = args.Size
109+ Seed = args.Seed
112110 Shrinks = nshrinks
113111 Journal = journal
114- RenderRecheck = renderRecheck
112+ RecheckType = args.RecheckType
115113 }
116- let takeSmallest tree = takeSmallest renderRecheck size seed tree ( nshrinks + 1 < shrinks>) shrinkLimit
114+ let takeSmallest tree = takeSmallest args tree ( nshrinks + 1 < shrinks>) shrinkLimit
117115 match x with
118116 | Failure ->
119117 match Seq.tryFind ( Outcome.isFailure << snd << Tree.outcome) xs with
@@ -130,7 +128,7 @@ module Property =
130128 | Success _ ->
131129 OK
132130
133- let private reportWith ' ( renderRecheck : bool ) ( size0 : Size ) ( seed : Seed ) ( config : PropertyConfig ) ( p : Property < unit >) : Report =
131+ let private reportWith ' ( args : PropertyArgs ) ( config : PropertyConfig ) ( p : Property < unit >) : Report =
134132 let random = toGen p |> Gen.toRandom
135133
136134 let nextSize size =
@@ -139,7 +137,7 @@ module Property =
139137 else
140138 size + 1
141139
142- let rec loop seed size tests discards =
140+ let rec loop args tests discards =
143141 if tests = config.TestLimit then
144142 { Tests = tests
145143 Discards = discards
@@ -149,24 +147,29 @@ module Property =
149147 Discards = discards
150148 Status = GaveUp }
151149 else
152- let seed1 , seed2 = Seed.split seed
153- let result = Random.run seed1 size random
150+ let seed1 , seed2 = Seed.split args.Seed
151+ let result = Random.run seed1 args.Size random
152+ let nextArgs = {
153+ args with
154+ Seed = seed2
155+ Size = nextSize args.Size
156+ }
154157
155158 match snd ( Tree.outcome result) with
156159 | Failure ->
157160 { Tests = tests + 1 < tests>
158161 Discards = discards
159- Status = takeSmallest renderRecheck size seed result 0 < shrinks> config.ShrinkLimit}
162+ Status = takeSmallest args result 0 < shrinks> config.ShrinkLimit}
160163 | Success () ->
161- loop seed2 ( nextSize size ) ( tests + 1 < tests>) discards
164+ loop nextArgs ( tests + 1 < tests>) discards
162165 | Discard ->
163- loop seed2 ( nextSize size ) tests ( discards + 1 < discards>)
166+ loop nextArgs tests ( discards + 1 < discards>)
164167
165- loop seed size0 0 < tests> 0 < discards>
168+ loop args 0 < tests> 0 < discards>
166169
167170 let reportWith ( config : PropertyConfig ) ( p : Property < unit >) : Report =
168- let seed = Seed.random ()
169- p |> reportWith' true 1 seed config
171+ let args = PropertyArgs.init
172+ p |> reportWith' args config
170173
171174 let report ( p : Property < unit >) : Report =
172175 p |> reportWith PropertyConfig.defaultConfig
@@ -201,10 +204,22 @@ module Property =
201204 | _ -> failure
202205
203206 let reportRecheckWith ( size : Size ) ( seed : Seed ) ( config : PropertyConfig ) ( p : Property < unit >) : Report =
204- reportWith' false size seed config p
207+ let args = {
208+ PropertyArgs.init with
209+ RecheckType = RecheckType.None
210+ Seed = seed
211+ Size = size
212+ }
213+ reportWith' args config p
205214
206215 let reportRecheck ( size : Size ) ( seed : Seed ) ( p : Property < unit >) : Report =
207- reportWith' false size seed PropertyConfig.defaultConfig p
216+ let args = {
217+ PropertyArgs.init with
218+ RecheckType = RecheckType.None
219+ Seed = seed
220+ Size = size
221+ }
222+ reportWith' args PropertyConfig.defaultConfig p
208223
209224 let reportRecheckBoolWith ( size : Size ) ( seed : Seed ) ( config : PropertyConfig ) ( p : Property < bool >) : Report =
210225 p |> bind ofBool |> reportRecheckWith size seed config
0 commit comments