Skip to content

Commit 42f92f3

Browse files
authored
Fix doctests for GHC 8.10 and 9.0 (#435)
* Fix doctests for GHC 8.10 and 9.0 Fix doctests to work for later versions of GHC. The cabal file specifies the default language to be Haskell2010 but doctest seems to not pickup this configuration. We fix this by passing this in as a command line argument to doctest. * run-ci-on-9.2.3
1 parent a7b90b8 commit 42f92f3

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- { cabal: "3.6", os: ubuntu-latest, ghc: "8.8.4" }
2626
- { cabal: "3.6", os: ubuntu-latest, ghc: "8.10.7" }
2727
- { cabal: "3.6", os: ubuntu-latest, ghc: "9.0.1" }
28-
- { cabal: "3.6", os: ubuntu-latest, ghc: "9.2.1" }
28+
- { cabal: "3.6", os: ubuntu-latest, ghc: "9.2.3" }
2929
# Win
3030
- { cabal: "3.6", os: windows-latest, ghc: "8.4.4" }
3131
# OOM when building tests

vector/tests/doctests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import Test.DocTest (doctest)
22

33
main :: IO ()
4-
main = doctest ["-Iinclude", "-Iinternal", "src/Data"]
4+
main = doctest [ "-Iinclude" , "-Iinternal" , "-XHaskell2010" , "src/Data" ]

vector/vector.cabal

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ test-suite vector-doctest
262262
if impl(ghc >= 9.0) && impl(ghc < 9.1)
263263
buildable: False
264264
-- And GHC 9.2 too
265-
if impl(ghc >= 9.2) && impl(ghc < 9.3)
265+
if impl(ghc >= 9.2) && impl(ghc < 9.2.3)
266266
buildable: False
267+
if impl(ghc >= 9.2.3) && impl(ghc < 9.3)
268+
buildable: True
267269
build-depends:
268270
base -any
269271
, doctest >=0.15 && <0.21

0 commit comments

Comments
 (0)