Skip to content

Commit 5b6549f

Browse files
Fix splice plugin test
1 parent ca851c5 commit 5b6549f

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

plugins/hls-splice-plugin/test/Main.hs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@ tests = testGroup "splice"
5757
, goldenTest "TQQTypeTypeError" Inplace 8 28
5858
, goldenTest "TSimpleDecl" Inplace 8 1
5959
, goldenTest "TQQDecl" Inplace 5 1
60-
, goldenTestWithEdit "TTypeKindError" Inplace 7 9
61-
, goldenTestWithEdit "TDeclKindError" Inplace 8 1
60+
, goldenTestWithEdit "TTypeKindError" (
61+
if ghcVersion >= GHC96 then
62+
"96-expected"
63+
else
64+
"expected"
65+
) Inplace 7 9
66+
, goldenTestWithEdit "TDeclKindError" "expected" Inplace 8 1
6267
]
6368

6469
goldenTest :: FilePath -> ExpandStyle -> Int -> Int -> TestTree
@@ -74,9 +79,9 @@ goldenTest fp tc line col =
7479
void $ skipManyTill anyMessage (message SWorkspaceApplyEdit)
7580
_ -> liftIO $ assertFailure "No CodeAction detected"
7681

77-
goldenTestWithEdit :: FilePath -> ExpandStyle -> Int -> Int -> TestTree
78-
goldenTestWithEdit fp tc line col =
79-
goldenWithHaskellDoc splicePlugin (fp <> " (golden)") testDataDir fp "expected" "hs" $ \doc -> do
82+
goldenTestWithEdit :: FilePath -> FilePath -> ExpandStyle -> Int -> Int -> TestTree
83+
goldenTestWithEdit fp expect tc line col =
84+
goldenWithHaskellDoc splicePlugin (fp <> " (golden)") testDataDir fp expect "hs" $ \doc -> do
8085
orig <- documentContents doc
8186
let
8287
lns = T.lines orig
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{-# LANGUAGE DataKinds #-}
2+
{-# LANGUAGE TemplateHaskell #-}
3+
module TTypeKindError where
4+
import Language.Haskell.TH ( numTyLit, litT )
5+
import Data.Proxy ( Proxy )
6+
7+
main :: 42
8+
main = return ()

0 commit comments

Comments
 (0)