-
Notifications
You must be signed in to change notification settings - Fork 30
/
PropertyConfig.fs
27 lines (21 loc) · 995 Bytes
/
PropertyConfig.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace Hedgehog
type PropertyConfig = internal {
TestLimit : int<tests>
ShrinkLimit : int<shrinks> option
}
module PropertyConfig =
/// The default configuration for a property test.
let defaultConfig : PropertyConfig =
{ TestLimit = 100<tests>
ShrinkLimit = None }
/// Set the number of times a property is allowed to shrink before the test
/// runner gives up and displays the counterexample.
let withShrinks (shrinkLimit : int<shrinks>) (config : PropertyConfig) : PropertyConfig =
{ config with ShrinkLimit = Some shrinkLimit }
/// Restores the default shrinking behavior.
let withoutShrinks (config : PropertyConfig) : PropertyConfig =
{ config with ShrinkLimit = None }
/// Set the number of times a property should be executed before it is
/// considered successful.
let withTests (testLimit : int<tests>) (config : PropertyConfig) : PropertyConfig =
{ config with TestLimit = testLimit }