Skip to content

Commit e728002

Browse files
committed
Test apply-refact with TypeApplications
1 parent 691f2be commit e728002

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,14 @@ hlintTests = testGroup "hlint suggestions" [
127127
doc <- openDoc "ApplyRefact2.hs" "haskell"
128128
testHlintDiagnostics doc
129129

130-
, testCase "apply-refact works with LambdaCase via ghc -XLambdaCase argument (#590)" $ runHlintSession "lambdacase" $ do
130+
, testCase "apply-refact works with -XLambdaCase argument (#590)" $ runHlintSession "lambdacase" $ do
131131
testRefactor "ApplyRefact1.hs" "Redundant bracket"
132132
expectedLambdaCase
133133

134+
, testCase "apply-refact works with -XTypeApplications argument (#1242)" $ runHlintSession "typeapps" $ do
135+
testRefactor "ApplyRefact1.hs" "Redundant bracket"
136+
expectedTypeApp
137+
134138
, testCase "apply hints works with LambdaCase via language pragma" $ runHlintSession "" $ do
135139
testRefactor "ApplyRefact1.hs" "Redundant bracket"
136140
("{-# LANGUAGE LambdaCase #-}" : expectedLambdaCase)
@@ -206,7 +210,9 @@ hlintTests = testGroup "hlint suggestions" [
206210
, "f = {- inline comment -}{- inline comment inside refactored code -} 1 -- ending comment", ""
207211
, "-- final comment"
208212
]
209-
213+
expectedTypeApp = [ "module ApplyRefact1 where", ""
214+
, "a = id @Int 1"
215+
]
210216
renameTests :: TestTree
211217
renameTests = testGroup "rename suggestions" [
212218
testCase "works" $ runSession hlsCommand noLiteralCaps "test/testdata" $ do

0 commit comments

Comments
 (0)