diff --git a/test/functional/FunctionalCodeAction.hs b/test/functional/FunctionalCodeAction.hs index ed99206f17..ca38bbb83a 100644 --- a/test/functional/FunctionalCodeAction.hs +++ b/test/functional/FunctionalCodeAction.hs @@ -127,10 +127,14 @@ hlintTests = testGroup "hlint suggestions" [ doc <- openDoc "ApplyRefact2.hs" "haskell" testHlintDiagnostics doc - , testCase "apply-refact works with LambdaCase via ghc -XLambdaCase argument (#590)" $ runHlintSession "lambdacase" $ do + , testCase "apply-refact works with -XLambdaCase argument (#590)" $ runHlintSession "lambdacase" $ do testRefactor "ApplyRefact1.hs" "Redundant bracket" expectedLambdaCase + , testCase "apply-refact works with -XTypeApplications argument (#1242)" $ runHlintSession "typeapps" $ do + testRefactor "ApplyRefact1.hs" "Redundant bracket" + expectedTypeApp + , testCase "apply hints works with LambdaCase via language pragma" $ runHlintSession "" $ do testRefactor "ApplyRefact1.hs" "Redundant bracket" ("{-# LANGUAGE LambdaCase #-}" : expectedLambdaCase) @@ -206,7 +210,9 @@ hlintTests = testGroup "hlint suggestions" [ , "f = {- inline comment -}{- inline comment inside refactored code -} 1 -- ending comment", "" , "-- final comment" ] - + expectedTypeApp = [ "module ApplyRefact1 where", "" + , "a = id @Int 1" + ] renameTests :: TestTree renameTests = testGroup "rename suggestions" [ testCase "works" $ runSession hlsCommand noLiteralCaps "test/testdata" $ do diff --git a/test/testdata/hlint/typeapps/ApplyRefact1.hs b/test/testdata/hlint/typeapps/ApplyRefact1.hs new file mode 100644 index 0000000000..78fa09aec4 --- /dev/null +++ b/test/testdata/hlint/typeapps/ApplyRefact1.hs @@ -0,0 +1,3 @@ +module ApplyRefact1 where + +a = (id @Int 1) diff --git a/test/testdata/hlint/typeapps/hie.yaml b/test/testdata/hlint/typeapps/hie.yaml new file mode 100644 index 0000000000..058382f9f0 --- /dev/null +++ b/test/testdata/hlint/typeapps/hie.yaml @@ -0,0 +1,5 @@ +cradle: + direct: + arguments: + - "-XTypeApplications" + - "ApplyRefact1"