Skip to content

Commit 6d627cc

Browse files
adapt to old QuickCheck versions and use an old LTS in stack test
1 parent 792a454 commit 6d627cc

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
with:
5959
enable-stack: true
6060
stack-version: latest
61-
ghc-version: 9.10.3
61+
ghc-version: 9.6.7
6262

6363
- name: Cache
6464
id: cache
@@ -67,8 +67,8 @@ jobs:
6767
path: |
6868
${{ steps.setup-haskell-stack.outputs.stack-root }}
6969
.stack-work
70-
key: ${{ runner.os }}-lts-24-${{ github.sha }}
71-
restore-keys: ${{ runner.os }}-lts-24
70+
key: ${{ runner.os }}-stack-${{ github.sha }}
71+
restore-keys: ${{ runner.os }}-stack
7272

7373
- name: Test
7474
run: stack test --coverage
@@ -78,7 +78,7 @@ jobs:
7878
path: |
7979
${{ steps.setup-haskell-stack.outputs.stack-root }}
8080
.stack-work
81-
key: ${{ runner.os }}-lts-24-${{ github.sha }}
81+
key: ${{ runner.os }}-stack-${{ github.sha }}
8282

8383
- name: Upload coverage report
8484
env:

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
snapshot: lts-24.14
1+
snapshot: lts-22.44
22
packages:
33
- .
44
system-ghc: true

stack.yaml.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
packages: []
77
snapshots:
88
- completed:
9-
sha256: d49e388e3afe59fe7a7be6d658e4ba4beec586e6237adab1e4a15b57c1d8a10f
10-
size: 726104
11-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/14.yaml
12-
original: lts-24.14
9+
sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9
10+
size: 721141
11+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/44.yaml
12+
original: lts-22.44

test/Constrained/Tests.hs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE AllowAmbiguousTypes #-}
2+
{-# LANGUAGE CPP #-}
23
{-# LANGUAGE ConstraintKinds #-}
34
{-# LANGUAGE DataKinds #-}
45
{-# LANGUAGE FlexibleContexts #-}
@@ -59,6 +60,15 @@ testAll = hspec $ tests False
5960
tests :: Bool -> Spec
6061
tests nightly =
6162
describe "constrained" . modifyMaxSuccess (\ms -> if nightly then ms * 10 else ms) $ do
63+
#if MIN_VERSION_QuickCheck(2, 16, 0)
64+
testSpec "setOfPairLetSpec" setOfPairLetSpec
65+
testSpec "setPair" setPair
66+
testSpec "mapElemSpec" mapElemSpec
67+
#else
68+
testSpecNoShrink "setOfPairLetSpec" setOfPairLetSpec
69+
testSpecNoShrink "setPair" setPair
70+
testSpecNoShrink "mapElemSpec" mapElemSpec
71+
#endif
6272
testSpec "complicatedEither" complicatedEither
6373
testSpec "pairCant" pairCant
6474
-- TODO: figure out why this doesn't shrink
@@ -70,7 +80,6 @@ tests nightly =
7080
testSpec "assertRealMultiple" assertRealMultiple
7181
testSpec "setSpec" setSpec
7282
testSpec "leqPair" leqPair
73-
testSpec "setPair" setPair
7483
testSpecNoShrink "listEmpty" listEmpty
7584
testSpec "compositionalSpec" compositionalSpec
7685
testSpec "simplePairSpec" simplePairSpec
@@ -80,7 +89,6 @@ tests nightly =
8089
testSpec "maybeSpec" maybeSpec
8190
testSpecNoShrink "eitherSetSpec" eitherSetSpec
8291
testSpec "fooSpec" fooSpec
83-
testSpec "mapElemSpec" mapElemSpec
8492
testSpec "mapElemKeySpec" mapElemKeySpec
8593
-- TODO: figure out why this doesn't shrink
8694
testSpecNoShrink "mapIsJust" mapIsJust
@@ -95,7 +103,6 @@ tests nightly =
95103
-- more detailed shrinking of `SuspendedSpec`s
96104
testSpecNoShrink "setPairSpec" setPairSpec
97105
testSpec "fixedSetSpec" fixedSetSpec
98-
testSpec "setOfPairLetSpec" setOfPairLetSpec
99106
testSpecNoShrink "emptyEitherSpec" emptyEitherSpec
100107
testSpecNoShrink "emptyEitherMemberSpec" emptyEitherMemberSpec
101108
testSpec "setSingletonSpec" setSingletonSpec

0 commit comments

Comments
 (0)