diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c7102f..a882ce2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,8 +93,9 @@ jobs: sudo apt-get update sudo apt-get install -y build-essential curl libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - ghcup install -u https://downloads.haskell.org/ghc/9.6.1/ghc-9.6.1-x86_64-deb9-linux.tar.xz ghc-head - ghcup set ghc ghc-head + ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml + ghcup install ghc 9.10.0.20240328 + ghcup set ghc 9.10.0.20240328 echo "cabal-store=$HOME/.cabal/store" >> $GITHUB_OUTPUT - name: Setup CI diff --git a/cabal.project b/cabal.project index f7bec5f..202b7f2 100644 --- a/cabal.project +++ b/cabal.project @@ -3,7 +3,10 @@ packages: write-ghc-environment-files: always +source-repository-package + type: git + location: https://github.com/haskell-unordered-containers/unordered-containers.git + tag: d52a0fd10bfa701cbbc9d7ac06bd7eb7664b3972 allow-newer: - *:base - , *:ghc-bignum + unordered-containers:template-haskell diff --git a/doctest-parallel.cabal b/doctest-parallel.cabal index a25ec78..9f387ff 100644 --- a/doctest-parallel.cabal +++ b/doctest-parallel.cabal @@ -26,6 +26,7 @@ tested-with: , GHC == 9.4.7 , GHC == 9.6.3 , GHC == 9.8.1 + , GHC == 9.10.1 extra-source-files: example/example.cabal @@ -102,7 +103,7 @@ library , directory , exceptions , filepath - , ghc >=8.2 && <9.9 + , ghc >=8.2 && <9.11 , ghc-paths >=0.1.0.9 , process , random >= 1.2 diff --git a/src/Test/DocTest/Internal/Extract.hs b/src/Test/DocTest/Internal/Extract.hs index d0cd8c9..a8e422d 100644 --- a/src/Test/DocTest/Internal/Extract.hs +++ b/src/Test/DocTest/Internal/Extract.hs @@ -329,8 +329,10 @@ extractLit loc = \case #else #if __GLASGOW_HASKELL__ < 904 HsPar _ (L l e) -> extractLit (locA l) e -#else +#elif __GLASGOW_HASKELL__ < 909 HsPar _ _ (L l e) _ -> extractLit (locA l) e +#else + HsPar _ (L l e) -> extractLit (locA l) e #endif #if __GLASGOW_HASKELL__ < 807 ExprWithTySig _ (L l e) -> extractLit l e diff --git a/src/Test/DocTest/Internal/Interpreter.hs b/src/Test/DocTest/Internal/Interpreter.hs index d16acfe..8e4cd3c 100644 --- a/src/Test/DocTest/Internal/Interpreter.hs +++ b/src/Test/DocTest/Internal/Interpreter.hs @@ -18,6 +18,7 @@ import System.Directory (getPermissions, executable) import Control.Monad import Control.Exception hiding (handle) import Data.Char +import Data.List (unsnoc) import GHC.Paths (ghc) import Test.DocTest.Internal.GhciWrapper @@ -76,13 +77,13 @@ safeEvalIt repl = either (return . Left) (fmap Right . evalIt repl) . filterExpr filterExpression :: String -> Either String String filterExpression e = - case lines e of + case map strip (lines e) of [] -> Right e - l -> if firstLine == ":{" && lastLine /= ":}" then fail_ else Right e - where - firstLine = strip $ head l - lastLine = strip $ last l - fail_ = Left "unterminated multiline command" + (firstLine:ls) -> + let lastLine = maybe firstLine snd (unsnoc ls) in + if firstLine == ":{" && lastLine /= ":}" then fail_ else Right e where + fail_ = Left "unterminated multiline command" + strip :: String -> String strip = dropWhile isSpace . reverse . dropWhile isSpace . reverse diff --git a/src/Test/DocTest/Internal/Runner/Example.hs b/src/Test/DocTest/Internal/Runner/Example.hs index 5c8b1a8..0b17c38 100644 --- a/src/Test/DocTest/Internal/Runner/Example.hs +++ b/src/Test/DocTest/Internal/Runner/Example.hs @@ -27,7 +27,7 @@ mkResult expected_ actual_ = -- use show to escape special characters in output lines if any output line -- contains any unsafe character escapeOutput - | any (not . isSafe) $ concat (expectedAsString ++ actual_) = init . tail . show . stripEnd + | any (not . isSafe) $ concat (expectedAsString ++ actual_) = init . drop 1 . show . stripEnd | otherwise = id actual :: [String]