Skip to content

Commit 5e2e743

Browse files
Merge branch 'master' into coveralls
2 parents 714117f + ae8ba1f commit 5e2e743

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

constrained-generators.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ source-repository head
1515
type: git
1616
location: https://github.com/input-output-hk/constrained-generators
1717

18-
flag devel
18+
flag dev
1919
description: Enable development mode
2020
default: False
2121
manual: True
@@ -52,7 +52,7 @@ library
5252

5353
hs-source-dirs: src
5454

55-
if flag(devel)
55+
if flag(dev)
5656
exposed-modules:
5757
Constrained.Examples
5858
Constrained.Examples.Basic

src/Constrained/Spec/SumProd.hs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,17 @@ chooseSpec ::
590590
chooseSpec (w, s) (w', s') =
591591
constrained $ \x ->
592592
exists (\eval -> pure $ if eval x `conformsToSpec` s then PickFirst else PickSecond) $ \p ->
593-
caseOn
594-
p
595-
(branchW w' $ \_ -> (x `satisfies` s))
596-
(branchW w $ \_ -> (x `satisfies` s'))
593+
[ caseOn
594+
p
595+
(branch $ \_ -> (x `satisfies` s))
596+
(branch $ \_ -> (x `satisfies` s'))
597+
-- This is a bit ugly :(
598+
, caseOn
599+
p
600+
(branchW w $ \_ -> True)
601+
(branchW w' $ \_ -> True)
602+
, x `dependsOn` p
603+
]
597604

598605
data Picky = PickFirst | PickSecond deriving (Ord, Eq, Show, Generic)
599606

test/Constrained/Tests.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ tests nightly =
156156
testSpecNoShrink "threeSpecific" threeSpecific
157157
testSpecNoShrink "threeSpecific'" threeSpecific'
158158
testSpecNoShrink "trueSpecUniform" trueSpecUniform
159+
testSpec "posNegDistr" posNegDistr
159160
testSpec "ifElseMany" ifElseMany
160161
testSpecNoShrink "propBack" propBack
161162
testSpecNoShrink "propBack'" propBack'

0 commit comments

Comments
 (0)