Skip to content

Commit 734ac75

Browse files
committed
Add a test for issue #67
1 parent 25d34c2 commit 734ac75

File tree

5 files changed

+49
-15
lines changed

5 files changed

+49
-15
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.15.20220808
11+
# version: 0.15.20221225
1212
#
13-
# REGENDATA ("0.15.20220808",["github","cabal.project"])
13+
# REGENDATA ("0.15.20221225",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -300,3 +300,11 @@ jobs:
300300
run: |
301301
rm -f cabal.project.local
302302
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
303+
- name: prepare for constraint sets
304+
run: |
305+
rm -f cabal.project.local
306+
- name: constraint set random-hashable
307+
run: |
308+
if [ $((! GHCJSARITH && HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' --dependencies-only -j2 all ; fi
309+
if [ $((! GHCJSARITH && HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' all ; fi
310+
if [ $((! GHCJSARITH && HCNUMVER >= 90400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' all ; fi

cabal.haskell-ci

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ docspec: >=8
77
-- constraint-set bytestring-0.11
88
-- ghc: >=7.8
99
-- constraints: bytestring ^>=0.11
10+
11+
constraint-set random-hashable
12+
ghc: ==9.4.*
13+
constraints: hashable >=1.3.2.0, hashable +random-initial-seed
14+
tests: True
15+
run-tests: True

fixtures/HashSet.expr

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
HS.fromList
2+
[
3+
"az",
4+
"dz",
5+
"ax",
6+
"bz",
7+
"cx",
8+
"cz",
9+
"dy",
10+
"bx",
11+
"cy",
12+
"by",
13+
"dx",
14+
"ay"]

tests/Tests.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Test.Tasty (TestTree, defaultMain, testGroup)
1111
import Test.Tasty.Golden.Advanced (goldenTest)
1212
import Test.Tasty.QuickCheck (testProperty)
1313

14+
import qualified Data.HashSet as HS
1415
import qualified Text.Parsec as P
1516
import qualified Text.PrettyPrint.ANSI.Leijen as WL
1617
import qualified Text.Trifecta as T (eof, parseString)
@@ -163,5 +164,9 @@ goldenTests = testGroup "Golden"
163164
return $ MyInt3 42
164165
, ediffGolden goldenTest "Positional" "fixtures/Positional.expr" $
165166
return $ Positional 12 True 'z'
167+
168+
-- issue #67
169+
, ediffGolden goldenTest "HashSet" "fixtures/HashSet.expr" $
170+
return $ HS.fromList [ [x,y] | x <- "abcd", y <- "xyz" ]
166171
]
167172

tree-diff.cabal

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,22 @@ library
8585

8686
-- GHC boot libraries
8787
build-depends:
88-
, base >=4.5 && <4.18
89-
, bytestring ^>=0.9.2.1 || ^>=0.10.0.2 || ^>=0.11.0.0
90-
, containers ^>=0.4.2.1 || ^>=0.5.0.0 || ^>=0.6.0.1
91-
, deepseq ^>=1.3.0.0 || ^>=1.4.0.0
88+
, base >=4.5 && <4.18
89+
, bytestring ^>=0.9.2.1 || ^>=0.10.0.2 || ^>=0.11.0.0
90+
, containers ^>=0.4.2.1 || ^>=0.5.0.0 || ^>=0.6.0.1
91+
, deepseq ^>=1.3.0.0 || ^>=1.4.0.0
9292
, parsec ^>=3.1.13.0
9393
, pretty ^>=1.1.1.0
94-
, text ^>=1.2.3.0 || ^>=2.0
95-
, time >=1.4 && <1.5 || >=1.5.0.1 && <1.6 || >=1.6.0.1 && <1.7 || >=1.8.0.2 && <1.9 || >=1.9.3 && <1.13
94+
, text ^>=1.2.3.0 || ^>=2.0
95+
, time >=1.4 && <1.5 || >=1.5.0.1 && <1.6 || >=1.6.0.1 && <1.7 || >=1.8.0.2 && <1.9 || >=1.9.3 && <1.13
9696

9797
build-depends:
98-
, aeson ^>=1.4.6.0 || ^>=1.5.6.0 || ^>=2.0.0.0 || ^>=2.1.0.0
99-
, ansi-terminal >=0.10 && <0.12
98+
, aeson ^>=1.4.6.0 || ^>=1.5.6.0 || ^>=2.0.0.0 || ^>=2.1.0.0
99+
, ansi-terminal >=0.10 && <0.12
100100
, ansi-wl-pprint ^>=0.6.8.2
101-
, base-compat >=0.10.5 && <0.11 || >=0.11.0 && <0.13
101+
, base-compat >=0.10.5 && <0.11 || >=0.11.0 && <0.13
102102
, bytestring-builder ^>=0.10.8.2.0
103-
, hashable ^>=1.2.7.0 || ^>=1.3.0.0 || ^>=1.4.0.1
103+
, hashable ^>=1.2.7.0 || ^>=1.3.0.0 || ^>=1.4.0.1
104104
, parsers ^>=0.12.10
105105
, primitive ^>=0.7.1.0
106106
, QuickCheck ^>=2.14.2
@@ -111,7 +111,7 @@ library
111111
, these ^>=1.1.1.1
112112
, unordered-containers ^>=0.2.8.0
113113
, uuid-types ^>=1.0.3
114-
, vector ^>=0.12.0.0 || ^>=0.13.0.0
114+
, vector ^>=0.12.0.0 || ^>=0.13.0.0
115115

116116
if impl(ghc <7.5)
117117
build-depends: ghc-prim
@@ -160,16 +160,17 @@ test-suite tree-diff-test
160160
, QuickCheck
161161
, tagged
162162
, tree-diff
163+
, unordered-containers
163164

164165
if impl(ghc <7.5)
165166
build-depends: ghc-prim
166167

167168
-- extra dependencies
168169
build-depends:
169-
, tasty ^>=1.2 || ^>=1.3.1 || ^>=1.4.2
170+
, tasty ^>=1.2 || ^>=1.3.1 || ^>=1.4.2
170171
, tasty-golden ^>=2.3.1.1
171172
, tasty-quickcheck ^>=0.10.1
172-
, trifecta >=2 && <2.2
173+
, trifecta >=2 && <2.2
173174

174175
benchmark tree-diff-bench
175176
default-language: Haskell2010

0 commit comments

Comments
 (0)