Skip to content

Commit 3816c44

Browse files
committed
fixup refactor nownBrokenForGhcVersions
1 parent bbe53ff commit 3816c44

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

Diff for: ghcide/test/exe/Main.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ highlightTests = testGroup "highlight"
20472047
, DocumentHighlight (R 6 10 6 13) (Just HkRead)
20482048
, DocumentHighlight (R 7 12 7 15) (Just HkRead)
20492049
]
2050-
, knownBrokenForGhcVersions [GHC90, GHC92, GHC94] "Ghc9 highlights the constructor and not just this field" $
2050+
, knownBrokenForGhcVersions (`elem` [GHC90, GHC92, GHC94]) "Ghc9 highlights the constructor and not just this field" $
20512051
testSessionWait "record" $ do
20522052
doc <- createDoc "A.hs" "haskell" recsource
20532053
_ <- waitForDiagnostics

Diff for: plugins/hls-change-type-signature-plugin/test/Main.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test :: TestTree
3838
test = testGroup "changeTypeSignature" [
3939
testRegexes
4040
, codeActionTest "TExpectedActual" 4 11
41-
, knownBrokenForGhcVersions [GHC92] "Error Message in 9.2 does not provide enough info" $ codeActionTest "TRigidType" 4 14
41+
, knownBrokenForGhcVersions (== GHC92) "Error Message in 9.2 does not provide enough info" $ codeActionTest "TRigidType" 4 14
4242
, codeActionTest "TLocalBinding" 7 22
4343
, codeActionTest "TLocalBindingShadow1" 11 8
4444
, codeActionTest "TLocalBindingShadow2" 7 22

Diff for: plugins/hls-eval-plugin/test/Main.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ tests =
8484
, goldenWithEval' "Shows a kind with :kind" "T12" "hs" (if ghcVersion == GHC92 then "ghc92.expected" else "expected")
8585
, goldenWithEval' "Reports an error for an incorrect type with :kind" "T13" "hs" (if ghcVersion == GHC92 then "ghc92.expected" else "expected")
8686
, goldenWithEval "Returns a fully-instantiated type for :type" "T14" "hs"
87-
, knownBrokenForGhcVersions [GHC92] "type +v does not work anymore with 9.2" $ goldenWithEval "Returns an uninstantiated type for :type +v, admitting multiple whitespaces around arguments" "T15" "hs"
87+
, knownBrokenForGhcVersions (==GHC92) "type +v does not work anymore with 9.2" $ goldenWithEval "Returns an uninstantiated type for :type +v, admitting multiple whitespaces around arguments" "T15" "hs"
8888
, goldenWithEval "Returns defaulted type for :type +d, admitting multiple whitespaces around arguments" "T16" "hs"
8989
, goldenWithEval' ":type reports an error when given with unknown +x option" "T17" "hs" (if ghcVersion == GHC92 then "ghc92.expected" else "expected")
9090
, goldenWithEval "Reports an error when given with unknown command" "T18" "hs"
@@ -143,7 +143,7 @@ tests =
143143
[ knownBrokenInEnv [HostOS Windows, GhcVer GHC86]
144144
"CPP eval on Windows and/or GHC <= 8.6 fails for some reasons" $
145145
goldenWithEval "CPP support" "TCPP" "hs"
146-
, knownBrokenForGhcVersions [GHC86]
146+
, knownBrokenForGhcVersions (==GHC86)
147147
"Preprocessor known to fail on GHC <= 8.6" $
148148
goldenWithEval "Literate Haskell Bird Style" "TLHS" "lhs"
149149
-- , goldenWithEval "Literate Haskell LaTeX Style" "TLHSLateX" "lhs"

Diff for: plugins/hls-hlint-plugin/test/Main.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ suggestionsTests =
181181
doc <- openDoc "IgnoreAnnHlint.hs" "haskell"
182182
expectNoMoreDiagnostics 3 doc "hlint"
183183

184-
, knownBrokenForGhcVersions [GHC92] "apply-refact has different behavior on v0.10" $
184+
, knownBrokenForGhcVersions (==GHC92) "apply-refact has different behavior on v0.10" $
185185
testCase "apply-refact preserve regular comments" $ runHlintSession "" $ do
186186
testRefactor "Comments.hs" "Redundant bracket" expectedComments
187187

Diff for: plugins/hls-refactor-plugin/test/Main.hs

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
{-# LANGUAGE LambdaCase #-}
2-
{-# LANGUAGE OverloadedStrings #-}
31
{-# LANGUAGE AllowAmbiguousTypes #-}
42
{-# LANGUAGE CPP #-}
53
{-# LANGUAGE DataKinds #-}
64
{-# LANGUAGE DuplicateRecordFields #-}
75
{-# LANGUAGE GADTs #-}
86
{-# LANGUAGE ImplicitParams #-}
7+
{-# LANGUAGE LambdaCase #-}
98
{-# LANGUAGE MultiWayIf #-}
9+
{-# LANGUAGE NamedFieldPuns #-}
10+
{-# LANGUAGE OverloadedStrings #-}
1011
{-# LANGUAGE PatternSynonyms #-}
1112
{-# LANGUAGE PolyKinds #-}
12-
{-# LANGUAGE TypeOperators #-}
13-
{-# LANGUAGE NamedFieldPuns #-}
1413
{-# LANGUAGE RecordWildCards #-}
14+
{-# LANGUAGE TypeOperators #-}
1515
{-# OPTIONS_GHC -Wno-deprecations -Wno-unticked-promoted-constructors #-}
1616

1717
module Main
1818
( main
1919
) where
2020

2121
import Control.Applicative.Combinators
22+
import Control.Lens ((^.))
2223
import Control.Monad
2324
import Data.Default
2425
import Data.Foldable
2526
import Data.List.Extra
2627
import Data.Maybe
2728
import qualified Data.Text as T
28-
import Development.IDE.Test
29+
import Data.Tuple.Extra
2930
import Development.IDE.GHC.Util
3031
import Development.IDE.Plugin.Completions.Types (extendImportCommandId)
32+
import Development.IDE.Test
3133
import Development.IDE.Types.Location
3234
import Development.Shake (getDirectoryFilesIO)
35+
import Ide.Types
3336
import Language.LSP.Test
3437
import Language.LSP.Types hiding
3538
(SemanticTokenAbsolute (length, line),
3639
SemanticTokenRelative (length),
3740
SemanticTokensEdit (_start),
3841
mkRange)
39-
import qualified Language.LSP.Types.Lens as L
42+
import qualified Language.LSP.Types as LSP
4043
import Language.LSP.Types.Capabilities
44+
import qualified Language.LSP.Types.Lens as L
4145
import System.Directory
4246
import System.FilePath
4347
import System.Info.Extra (isMac, isWindows)
4448
import qualified System.IO.Extra
4549
import System.IO.Extra hiding (withTempDir)
46-
import Control.Lens ((^.))
47-
import Data.Tuple.Extra
48-
import Ide.Types
49-
import qualified Language.LSP.Types as LSP
5050
import System.Time.Extra
5151
import Test.Tasty
5252
import Test.Tasty.ExpectedFailure
5353
import Test.Tasty.HUnit
5454
import Text.Regex.TDFA ((=~))
5555

5656

57-
import Test.Hls
5857
import Development.IDE.Plugin.CodeAction (matchRegExMultipleImports)
58+
import Test.Hls
5959

60-
import qualified Development.IDE.Plugin.CodeAction as Refactor
61-
import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
60+
import qualified Development.IDE.Plugin.CodeAction as Refactor
61+
import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
6262

6363
main :: IO ()
6464
main = defaultTestRunner tests
@@ -2337,7 +2337,7 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
23372337
, ""
23382338
, "f = seq (\"debug\" :: " <> listOfChar <> ") traceShow \"debug\""
23392339
])
2340-
, knownBrokenForGhcVersions [GHC92] "GHC 9.2 only has 'traceShow' in error span" $
2340+
, knownBrokenForGhcVersions (==GHC92) "GHC 9.2 only has 'traceShow' in error span" $
23412341
testSession "add default type to satisfy two constraints" $
23422342
testFor
23432343
(T.unlines [ "{-# OPTIONS_GHC -Wtype-defaults #-}"
@@ -2358,7 +2358,7 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
23582358
, ""
23592359
, "f a = traceShow (\"debug\" :: " <> listOfChar <> ") a"
23602360
])
2361-
, knownBrokenForGhcVersions [GHC92] "GHC 9.2 only has 'traceShow' in error span" $
2361+
, knownBrokenForGhcVersions (==GHC92) "GHC 9.2 only has 'traceShow' in error span" $
23622362
testSession "add default type to satisfy two constraints with duplicate literals" $
23632363
testFor
23642364
(T.unlines [ "{-# OPTIONS_GHC -Wtype-defaults #-}"

Diff for: test/functional/FunctionalCodeAction.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ unusedTermTests = testGroup "unused term code actions" [
369369
]
370370

371371
expectFailIfGhc92 :: String -> TestTree -> TestTree
372-
expectFailIfGhc92 = knownBrokenForGhcVersions [GHC92]
372+
expectFailIfGhc92 = knownBrokenForGhcVersions (==GHC92)
373373

374374
disableWingman :: Session ()
375375
disableWingman =

Diff for: test/functional/TypeDefinition.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tests = testGroup "type definitions" [
1313
$ getTypeDefinitionTest' 15 21 12 0
1414
, testCase "finds local definition of sum type variable"
1515
$ getTypeDefinitionTest' 20 13 17 0
16-
, knownBrokenForGhcVersions [GHC88] "Definition of sum type not found from data constructor in GHC 8.8.x" $
16+
, knownBrokenForGhcVersions (==GHC88) "Definition of sum type not found from data constructor in GHC 8.8.x" $
1717
testCase "finds local definition of sum type constructor"
1818
$ getTypeDefinitionTest' 23 7 17 0
1919
, testCase "finds non-local definition of type def"

0 commit comments

Comments
 (0)