Skip to content

Commit be754d9

Browse files
jneiramergify[bot]
andauthored
Test apply-refact with TypeApplications (#1244)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent f03a7fa commit be754d9

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-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
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module ApplyRefact1 where
2+
3+
a = (id @Int 1)

test/testdata/hlint/typeapps/hie.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cradle:
2+
direct:
3+
arguments:
4+
- "-XTypeApplications"
5+
- "ApplyRefact1"

0 commit comments

Comments
 (0)