Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for GHC 9.10.* #127

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ jobs:
- '9.4'
- '9.6'
- '9.8'
- '9.10'
include:
- os: macos-latest
- os: macos-12
ghc: system
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -54,17 +55,14 @@ jobs:
- shell: bash
run: cabal update

- shell: bash
run: cabal configure --enable-tests --enable-benchmarks

- shell: bash
run: cabal build all

- shell: bash
run: echo | cabal repl sensei --build-depends hspec-meta

- shell: bash
run: cabal exec -- "${PWD}/$(find dist-newstyle/ -name spec -type f)" --times --print-slow
run: cabal exec -- $(cabal list-bin spec) --times --print-slow
env:
HSPEC_OPTIONS: --color

Expand Down
5 changes: 5 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ package sensei
ghc-options: -Werror

tests: True

source-repository-package
type: git
location: https://github.com/sol/hinotify/
tag: 2131698f86939542c7df2cf3e60b40cc7e42819c
5 changes: 4 additions & 1 deletion src/Trigger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ reloadedSuccessfully = any success . lines
success :: String -> Bool
success x = case stripPrefix "Ok, " x of
Just "one module loaded." -> True
Just "one module reloaded." -> True
Just "1 module loaded." -> True
Just "1 module reloaded." -> True
Just xs | [_number, "modules", "loaded."] <- words xs -> True
Just xs -> "modules loaded: " `isPrefixOf` xs
Just xs | [_number, "modules", "reloaded."] <- words xs -> True
Just xs -> "modules loaded: " `isPrefixOf` xs || "modules reloaded: " `isPrefixOf` xs
Nothing -> False

removeProgress :: String -> String
Expand Down
11 changes: 10 additions & 1 deletion test/Helper.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
module Helper (
module Imports
, silent
Expand Down Expand Up @@ -97,7 +98,7 @@ data Status = Ok | Failed
deriving (Eq, Show)

modulesLoaded :: Status -> [String] -> String
modulesLoaded status xs = show status ++ ", " ++ mods ++ " loaded."
modulesLoaded status xs = show status ++ ", " ++ mods ++ " " ++ loaded ++ "."
where
n = length xs
mods
Expand All @@ -109,3 +110,11 @@ modulesLoaded status xs = show status ++ ", " ++ mods ++ " loaded."
| n == 5 = "five modules"
| n == 6 = "six modules"
| otherwise = show n ++ " modules"

#if __GLASGOW_HASKELL__ < 910
loaded = "loaded"
#else
loaded
| n == 0 = "to be reloaded"
| otherwise = "reloaded"
#endif
5 changes: 5 additions & 0 deletions test/TriggerSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,16 @@ spec = do
writeFile name (passingSpec ++ "foo = bar")
(trigger session >> trigger session) `shouldReturn` (Failure, [
"[1 of 1] Compiling Spec"
#if __GLASGOW_HASKELL__ < 910
, ""
#endif
#if __GLASGOW_HASKELL__ >= 906
, "Spec.hs:9:7: error: [GHC-88464] Variable not in scope: bar"
#else
, "Spec.hs:9:7: error: Variable not in scope: bar"
#endif
#if __GLASGOW_HASKELL__ >= 910
, ""
#endif
, modulesLoaded Failed []
, withColor Red "RELOADING FAILED"
Expand Down
Loading