Skip to content

Commit c2073f9

Browse files
committed
Add hlint test with LambdaCase
1 parent 60a222d commit c2073f9

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,21 @@ hlintTests = testGroup "hlint suggestions" [
9696

9797
liftIO $ Just "hlint" `notElem` map (^. L.source) diags' @? "There are no hlint diagnostics"
9898

99-
, testCase "changing document contents updates hlint diagnostics" $ runSession hlsCommand fullCaps "test/testdata/hlint" $ do
100-
doc <- openDoc "ApplyRefact2.hs" "haskell"
99+
, testCase "apply hints works with LambdaCase" $ runSession hlsCommand fullCaps "test/testdata/hlint" $ do
100+
doc <- openDoc "ApplyRefact1.hs" "haskell"
101101
diags <- waitForDiagnosticsSource "hlint"
102102

103-
liftIO $ length diags @?= 2 -- "Eta Reduce" and "Redundant Id"
103+
liftIO $ length diags @?= 1
104104

105105
let change = TextDocumentContentChangeEvent
106-
(Just (Range (Position 1 8) (Position 1 12)))
107-
Nothing "x"
106+
(Just (Range (Position 3 21) (Position 3 27)))
107+
Nothing "True"
108108

109109
changeDoc doc [change]
110110

111111
diags' <- waitForDiagnostics
112112

113113
liftIO $ (not $ Just "hlint" `elem` map (^. L.source) diags') @? "There are no hlint diagnostics"
114-
115-
let change' = TextDocumentContentChangeEvent
116-
(Just (Range (Position 1 8) (Position 1 12)))
117-
Nothing "id x"
118-
119-
changeDoc doc [change']
120-
121-
diags'' <- waitForDiagnosticsFromSource doc "hlint"
122-
123-
liftIO $ length diags'' @?= 2
124114
]
125115

126116
renameTests :: TestTree

test/testdata/hlint/hie.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
cradle:
22
direct:
33
arguments:
4+
- -XLambdaCase
45
- "ApplyRefact2"

0 commit comments

Comments
 (0)