@@ -18,38 +18,38 @@ import Data.Tree
1818
1919benchmarks :: Benchmark
2020benchmarks =
21- bgroup
22- " constrained"
23- [ benchSpec 10 30 " TrueSpec@Map" (trueSpec :: Specification (Map Int Int ))
24- , benchSpec 10 30 " TrueSpec@[]" (trueSpec :: Specification [Int ])
25- , benchSpec 10 30 " TrueSpec@Set" (trueSpec :: Specification (Set Int ))
26- , benchSpec
27- 10
28- 30
29- " TrueSpec@Tree"
30- (giveHint (Nothing , 30 ) <> trueSpec :: Specification (Tree Int ))
31- , benchSpec 10 30 " roseTreeMaybe" roseTreeMaybe
32- , benchSpec 10 30 " listSumPair" listSumPair
33- ]
21+ bgroup
22+ " constrained"
23+ [ benchSpec 10 30 " TrueSpec@Map" (trueSpec :: Specification (Map Int Int ))
24+ , benchSpec 10 30 " TrueSpec@[]" (trueSpec :: Specification [Int ])
25+ , benchSpec 10 30 " TrueSpec@Set" (trueSpec :: Specification (Set Int ))
26+ , benchSpec
27+ 10
28+ 30
29+ " TrueSpec@Tree"
30+ (giveHint (Nothing , 30 ) <> trueSpec :: Specification (Tree Int ))
31+ , benchSpec 10 30 " roseTreeMaybe" roseTreeMaybe
32+ , benchSpec 10 30 " listSumPair" listSumPair
33+ ]
3434
3535roseTreeMaybe :: Specification (Tree (Maybe (Int , Int )))
3636roseTreeMaybe = constrained $ \ t ->
37- [ forAll' t $ \ mp ts ->
38- forAll ts $ \ t' ->
39- onJust mp $ \ p ->
40- onJust (rootLabel_ t') $ \ p' ->
41- fst_ p' ==. snd_ p
42- , forAll' t $ \ mp _ -> isJust mp
43- , genHint (Nothing , 10 ) t
44- ]
37+ [ forAll' t $ \ mp ts ->
38+ forAll ts $ \ t' ->
39+ onJust mp $ \ p ->
40+ onJust (rootLabel_ t') $ \ p' ->
41+ fst_ p' ==. snd_ p
42+ , forAll' t $ \ mp _ -> isJust mp
43+ , genHint (Nothing , 10 ) t
44+ ]
4545
4646listSumPair :: Specification [(Int , Int )]
4747listSumPair = constrained $ \ xs ->
48- [ assert $ foldMap_ fst_ xs ==. 100
49- , forAll' xs $ \ x y -> [20 <. x, x <. 30 , y <. 100 ]
50- ]
48+ [ assert $ foldMap_ fst_ xs ==. 100
49+ , forAll' xs $ \ x y -> [20 <. x, x <. 30 , y <. 100 ]
50+ ]
5151
5252benchSpec :: (HasSpec a , NFData a ) => Int -> Int -> String -> Specification a -> Benchmark
5353benchSpec seed size nm spec =
54- bench (unlines [nm, show (genFromSpecWithSeed seed size spec)]) $
55- nf (genFromSpecWithSeed seed size) spec
54+ bench (unlines [nm, show (genFromSpecWithSeed seed size spec)]) $
55+ nf (genFromSpecWithSeed seed size) spec
0 commit comments