Skip to content

Commit

Permalink
Fix 9.4 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wz1000 committed Dec 22, 2022
1 parent 928a4ff commit ddf34a5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ jobs:
name: Test hls-call-hierarchy-plugin test suite
run: cabal test hls-call-hierarchy-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-call-hierarchy-plugin --test-options="$TEST_OPTS"

- if: matrix.test && matrix.os != 'windows-latest'
- if: matrix.test && matrix.os != 'windows-latest' && matrix.ghc != '9.4.2' && matrix.ghc != '9.4.3'
name: Test hls-rename-plugin test suite
run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-rename-plugin --test-options="$TEST_OPTS"

Expand Down
4 changes: 2 additions & 2 deletions plugins/hls-hlint-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ suggestionsTests =
doc <- openDoc "IgnoreAnnHlint.hs" "haskell"
expectNoMoreDiagnostics 3 doc "hlint"

, knownBrokenForGhcVersions [GHC92] "apply-refact has different behavior on v0.10" $
, knownBrokenForGhcVersions [GHC92, GHC94] "apply-refact has different behavior on v0.10" $
testCase "apply-refact preserve regular comments" $ runHlintSession "" $ do
testRefactor "Comments.hs" "Redundant bracket" expectedComments

, onlyRunForGhcVersions [GHC92] "only run test for apply-refact-0.10" $
, onlyRunForGhcVersions [GHC92, GHC94] "only run test for apply-refact-0.10" $
testCase "apply-refact preserve regular comments" $ runHlintSession "" $ do
testRefactor "Comments.hs" "Redundant bracket" expectedComments'

Expand Down
19 changes: 12 additions & 7 deletions plugins/hls-refactor-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ renameActionTests = testGroup "rename actions"
doc <- createDoc "Testing.hs" "haskell" content
_ <- waitForDiagnostics
actionsOrCommands <- getCodeActions doc (Range (Position 3 12) (Position 3 20))
[fixTypo] <- pure [action | InR action@CodeAction{ _title = actionTitle } <- actionsOrCommands, "monus" `T.isInfixOf` actionTitle ]
[fixTypo] <- pure [action | InR action@CodeAction{ _title = actionTitle } <- actionsOrCommands, "monus" `T.isInfixOf` actionTitle , "Replace" `T.isInfixOf` actionTitle]
executeCodeAction fixTypo
contentAfterAction <- documentContents doc
let expectedContentAfterAction = T.unlines
Expand Down Expand Up @@ -1669,8 +1669,10 @@ suggestImportTests = testGroup "suggest import actions"
, test True [] "f = empty" [] "import Control.Applicative (empty)"
, test True [] "f = empty" [] "import Control.Applicative"
, test True [] "f = (&)" [] "import Data.Function ((&))"
, test True [] "f = NE.nonEmpty" [] "import qualified Data.List.NonEmpty as NE"
, test True [] "f = Data.List.NonEmpty.nonEmpty" [] "import qualified Data.List.NonEmpty"
, ignoreForGHC94 "On GHC 9.4 the error message doesn't contain the qualified module name"
$ test True [] "f = NE.nonEmpty" [] "import qualified Data.List.NonEmpty as NE"
, ignoreForGHC94 "On GHC 9.4 the error message doesn't contain the qualified module name"
$ test True [] "f = Data.List.NonEmpty.nonEmpty" [] "import qualified Data.List.NonEmpty"
, test True [] "f :: Typeable a => a" ["f = undefined"] "import Data.Typeable (Typeable)"
, test True [] "f = pack" [] "import Data.Text (pack)"
, test True [] "f :: Text" ["f = undefined"] "import Data.Text (Text)"
Expand All @@ -1679,14 +1681,17 @@ suggestImportTests = testGroup "suggest import actions"
, test True [] "f = (.|.)" [] "import Data.Bits (Bits((.|.)))"
, test True [] "f = (.|.)" [] "import Data.Bits ((.|.))"
, test True [] "f :: a ~~ b" [] "import Data.Type.Equality ((~~))"
, test True
, ignoreForGHC94 "On GHC 9.4 the error message doesn't contain the qualified module name"
$ test True
["qualified Data.Text as T"
] "f = T.putStrLn" [] "import qualified Data.Text.IO as T"
, test True
, ignoreForGHC94 "On GHC 9.4 the error message doesn't contain the qualified module name"
$ test True
[ "qualified Data.Text as T"
, "qualified Data.Function as T"
] "f = T.putStrLn" [] "import qualified Data.Text.IO as T"
, test True
, ignoreForGHC94 "On GHC 9.4 the error message doesn't contain the qualified module name"
$ test True
[ "qualified Data.Text as T"
, "qualified Data.Function as T"
, "qualified Data.Functor as T"
Expand Down Expand Up @@ -3784,7 +3789,7 @@ ignoreForGHC92 :: String -> TestTree -> TestTree
ignoreForGHC92 = ignoreFor (BrokenForGHC [GHC92])

ignoreForGHC94 :: String -> TestTree -> TestTree
ignoreForGHC94 = ignoreFor (BrokenForGHC [GHC94])
ignoreForGHC94 = knownIssueFor Broken (BrokenForGHC [GHC94])

data BrokenTarget =
BrokenSpecific OS [GhcVersion]
Expand Down
1 change: 0 additions & 1 deletion plugins/hls-refactor-plugin/test/data/hiding/hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ cradle:
direct:
arguments:
- -Wall
- HideFunction.hs
- AVec.hs
- BVec.hs
- CVec.hs
Expand Down

0 comments on commit ddf34a5

Please sign in to comment.