@@ -43,7 +43,6 @@ import Language.LSP.Protocol.Types hiding
43
43
import Language.LSP.Test
44
44
import System.Directory
45
45
import System.FilePath
46
- import System.Info.Extra (isMac , isWindows )
47
46
import qualified System.IO.Extra
48
47
import System.IO.Extra hiding (withTempDir )
49
48
import System.Time.Extra
@@ -1313,7 +1312,7 @@ extendImportTests = testGroup "extend import actions"
1313
1312
, " b :: A"
1314
1313
, " b = ConstructorFoo"
1315
1314
])
1316
- , ignoreForGHC94 " On GHC 9.4, the error messages with -fdefer-type-errors don't have necessary imported target srcspan info." $
1315
+ , brokenForGHC94 " On GHC 9.4, the error messages with -fdefer-type-errors don't have necessary imported target srcspan info." $
1317
1316
testSession " extend single line qualified import with value" $ template
1318
1317
[(" ModuleA.hs" , T. unlines
1319
1318
[ " module ModuleA where"
@@ -1485,7 +1484,7 @@ extendImportTests = testGroup "extend import actions"
1485
1484
, " import A (pattern Some)"
1486
1485
, " k (Some x) = x"
1487
1486
])
1488
- , ignoreFor ( BrokenForGHC [GHC92 , GHC94 ]) " Diagnostic message has no suggestions" $
1487
+ , ignoreForGhcVersions [GHC92 , GHC94 ] " Diagnostic message has no suggestions" $
1489
1488
testSession " type constructor name same as data constructor name" $ template
1490
1489
[(" ModuleA.hs" , T. unlines
1491
1490
[ " module ModuleA where"
@@ -1751,7 +1750,7 @@ suggestImportTests = testGroup "suggest import actions"
1751
1750
suggestAddRecordFieldImportTests :: TestTree
1752
1751
suggestAddRecordFieldImportTests = testGroup " suggest imports of record fields when using OverloadedRecordDot"
1753
1752
[ testGroup " The field is suggested when an instance resolution failure occurs"
1754
- [ ignoreFor ( BrokenForGHC [GHC90 , GHC94 , GHC96 ]) " Extension not present <9.2, and the assist is derived from the help message in >=9.4" theTest
1753
+ [ ignoreForGhcVersions [GHC90 , GHC94 , GHC96 ] " Extension not present <9.2, and the assist is derived from the help message in >=9.4" theTest
1755
1754
]
1756
1755
]
1757
1756
where
@@ -3190,7 +3189,7 @@ exportUnusedTests = testGroup "export unused actions"
3190
3189
(R 2 0 2 11 )
3191
3190
" Export ‘bar’"
3192
3191
Nothing
3193
- , ignoreFor ( BrokenForGHC [GHC92 , GHC94 ]) " Diagnostic message has no suggestions" $
3192
+ , ignoreForGhcVersions [GHC92 , GHC94 ] " Diagnostic message has no suggestions" $
3194
3193
testSession " type is exported but not the constructor of same name" $ template
3195
3194
(T. unlines
3196
3195
[ " {-# OPTIONS_GHC -Wunused-top-binds #-}"
@@ -3840,45 +3839,10 @@ withTempDir f = System.IO.Extra.withTempDir $ \dir -> do
3840
3839
f dir'
3841
3840
3842
3841
ignoreForGHC92 :: String -> TestTree -> TestTree
3843
- ignoreForGHC92 = ignoreFor (BrokenForGHC [GHC92 ])
3844
-
3845
- ignoreForGHC94 :: String -> TestTree -> TestTree
3846
- ignoreForGHC94 = knownIssueFor Broken (BrokenForGHC [GHC94 ])
3847
-
3848
- data BrokenTarget =
3849
- BrokenSpecific OS [GhcVersion ]
3850
- -- ^ Broken for `BrokenOS` with `GhcVersion`
3851
- | BrokenForOS OS
3852
- -- ^ Broken for `BrokenOS`
3853
- | BrokenForGHC [GhcVersion ]
3854
- -- ^ Broken for `GhcVersion`
3855
- deriving (Show )
3856
-
3857
- -- | Ignore test for specific os and ghc with reason.
3858
- ignoreFor :: BrokenTarget -> String -> TestTree -> TestTree
3859
- ignoreFor = knownIssueFor Ignore
3860
-
3861
- -- | Deal with `IssueSolution` for specific OS and GHC.
3862
- knownIssueFor :: IssueSolution -> BrokenTarget -> String -> TestTree -> TestTree
3863
- knownIssueFor solution = go . \ case
3864
- BrokenSpecific bos vers -> isTargetOS bos && isTargetGhc vers
3865
- BrokenForOS bos -> isTargetOS bos
3866
- BrokenForGHC vers -> isTargetGhc vers
3867
- where
3868
- isTargetOS = \ case
3869
- Windows -> isWindows
3870
- MacOS -> isMac
3871
- Linux -> not isWindows && not isMac
3872
-
3873
- isTargetGhc = elem ghcVersion
3874
-
3875
- go True = case solution of
3876
- Broken -> expectFailBecause
3877
- Ignore -> ignoreTestBecause
3878
- go False = \ _ -> id
3879
-
3842
+ ignoreForGHC92 = ignoreForGhcVersions [GHC92 ]
3880
3843
3881
- data IssueSolution = Broken | Ignore deriving (Show )
3844
+ brokenForGHC94 :: String -> TestTree -> TestTree
3845
+ brokenForGHC94 = knownBrokenForGhcVersions [GHC94 ]
3882
3846
3883
3847
-- | Assert that a value is not 'Nothing', and extract the value.
3884
3848
assertJust :: MonadIO m => String -> Maybe a -> m a
0 commit comments