Skip to content

Commit 71681cd

Browse files
Improve coverage
1 parent 35ab362 commit 71681cd

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

test/Constrained/Tests.hs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,18 @@ testAll = hspec $ tests False
5959
tests :: Bool -> Spec
6060
tests nightly =
6161
describe "constrained" . modifyMaxSuccess (\ms -> if nightly then ms * 10 else ms) $ do
62-
-- TODO: double-shrinking
62+
-- TODO: figure out why this doesn't shrink
6363
testSpecNoShrink "reifiesMultiple" reifiesMultiple
6464
testSpec "assertReal" assertReal
6565
testSpecNoShrink "chooseBackwards" chooseBackwards
6666
testSpecNoShrink "chooseBackwards'" chooseBackwards'
67-
-- TODO: turn this on again when QuickCheck version is bumped
68-
-- testSpec "whenTrueExists" whenTrueExists
67+
testSpec "whenTrueExists" whenTrueExists
6968
testSpec "assertRealMultiple" assertRealMultiple
70-
-- TODO: quickcheck version
71-
testSpecNoShrink "setSpec" setSpec
69+
testSpec "setSpec" setSpec
7270
testSpec "leqPair" leqPair
7371
testSpec "setPair" setPair
7472
testSpecNoShrink "listEmpty" listEmpty
75-
-- TODO: quickcheck version
76-
testSpecNoShrink "compositionalSpec" compositionalSpec
73+
testSpec "compositionalSpec" compositionalSpec
7774
testSpec "simplePairSpec" simplePairSpec
7875
testSpec "trickyCompositional" trickyCompositional
7976
testSpec "emptyListSpec" emptyListSpec
@@ -83,18 +80,19 @@ tests nightly =
8380
testSpec "fooSpec" fooSpec
8481
testSpec "mapElemSpec" mapElemSpec
8582
testSpec "mapElemKeySpec" mapElemKeySpec
86-
-- TODO: double shrinking
83+
-- TODO: figure out why this doesn't shrink
8784
testSpecNoShrink "mapIsJust" mapIsJust
8885
testSpecNoShrink "eitherKeys" eitherKeys
86+
-- TODO: figure out why this doesn't shrink
8987
testSpecNoShrink "intSpec" intSpec
90-
testSpecNoShrink "mapPairSpec" mapPairSpec
88+
testSpec "mapPairSpec" mapPairSpec
89+
-- TODO: figure out why this doesn't shrink
9190
testSpecNoShrink "mapEmptyDomainSpec" mapEmptyDomainSpec
9291
-- TODO: this _can_ be shrunk, but it's incredibly expensive to do
9392
-- so and it's not obvious if there is a faster way without implementing
9493
-- more detailed shrinking of `SuspendedSpec`s
9594
testSpecNoShrink "setPairSpec" setPairSpec
96-
-- TODO: quickcheck version
97-
testSpecNoShrink "fixedSetSpec" fixedSetSpec
95+
testSpec "fixedSetSpec" fixedSetSpec
9896
testSpec "setOfPairLetSpec" setOfPairLetSpec
9997
testSpecNoShrink "emptyEitherSpec" emptyEitherSpec
10098
testSpecNoShrink "emptyEitherMemberSpec" emptyEitherMemberSpec
@@ -107,19 +105,19 @@ tests nightly =
107105
testSpec "maybeJustSetSpec" maybeJustSetSpec
108106
testSpec "weirdSetPairSpec" weirdSetPairSpec
109107
testSpec "knownDomainMap" knownDomainMap
110-
-- TODO: figure out double-shrinking
108+
-- TODO: figure out why this doesn't shrink
111109
testSpecNoShrink "testRewriteSpec" testRewriteSpec
112110
testSpec "parallelLet" parallelLet
113111
testSpec "letExists" letExists
114112
testSpec "letExistsLet" letExistsLet
115113
testSpec "notSubset" notSubset
116114
testSpec "unionSized" unionSized
117-
-- TODO: figure out double-shrinking
115+
-- TODO: figure out why this doesn't shrink
118116
testSpecNoShrink "dependencyWeirdness" dependencyWeirdness
119117
testSpec "foldTrueCases" foldTrueCases
120118
testSpec "foldSingleCase" foldSingleCase
121119
testSpec "listSumPair" (listSumPair @Int)
122-
-- TODO: figure out double-shrinking
120+
-- TODO: figure out why this doesn't shrink
123121
testSpecNoShrink "parallelLetPair" parallelLetPair
124122
testSpec "mapSizeConstrained" mapSizeConstrained
125123
testSpec "isAllZeroTree" isAllZeroTree
@@ -137,13 +135,12 @@ tests nightly =
137135
testSpec "sumRange" sumRange
138136
testSpec "sumListBad" sumListBad
139137
testSpec "listExistsUnfree" listExistsUnfree
140-
-- TODO: turn this on when we bump quickcheck version
141-
-- testSpec "listSumShort" listSumShort
138+
testSpec "listSumShort" listSumShort
142139
testSpec "existsUnfree" existsUnfree
143140
testSpec "appendSize" appendSize
144141
testSpecNoShrink "appendSingleton" appendSingleton
145142
testSpec "singletonSubset" singletonSubset
146-
-- TODO: double shrinking
143+
-- TODO: figure out why this doesn't shrink
147144
testSpecNoShrink "reifyYucky" reifyYucky
148145
testSpec "fixedRange" fixedRange
149146
testSpec "rangeHint" rangeHint
@@ -470,6 +467,3 @@ foldWithSizeTests = do
470467
prop "something of size 2, can add to 0 in type with negative values." $
471468
testFoldSpec @Int (between 2 2) (between (-10) 10) (MemberSpec (pure 0)) Succeed
472469
prop "TEST listSum" $ prop_constrained_satisfies_sound (listSum @Int)
473-
474-
-- TODO Needs to sample like this: OR [pick t c | t <- total, c <- count]
475-
-- prop "count =0, total is 0,1,2" $ testFoldSpec @Int (between 0 1) evenSpec (between 0 2) Succeed

0 commit comments

Comments
 (0)