Skip to content

Commit

Permalink
Test apply-refact with TypeApplications
Browse files Browse the repository at this point in the history
  • Loading branch information
jneira committed Jan 21, 2021
1 parent 691f2be commit e728002
Showing 1 changed file with 8 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

0 comments on commit e728002

Please sign in to comment.