Skip to content

Commit

Permalink
Test apply-refact with TypeApplications (#1244)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
jneira and mergify[bot] committed Jan 22, 2021
1 parent f03a7fa commit be754d9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/functional/FunctionalCodeAction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/testdata/hlint/typeapps/ApplyRefact1.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module ApplyRefact1 where

a = (id @Int 1)
5 changes: 5 additions & 0 deletions test/testdata/hlint/typeapps/hie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cradle:
direct:
arguments:
- "-XTypeApplications"
- "ApplyRefact1"

0 comments on commit be754d9

Please sign in to comment.