File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,16 @@ hlintTests = testGroup "hlint suggestions" [
73
73
74
74
_ <- waitForDiagnostics
75
75
76
- (CACommand cmdApplyAll : _) <- getAllCodeActions doc
76
+ (CACommand cmd : _) <- getAllCodeActions doc
77
77
78
- executeCommand cmdApplyAll
78
+ executeCommand cmd
79
+
80
+ let expectedContent = if " Apply all hints" `T.isSuffixOf` (cmd ^. L. title)
81
+ then " main = undefined\n foo = id\n "
82
+ else " main = undefined\n foo x = x\n " -- only redundant id
79
83
80
84
contents <- skipManyTill publishDiagnosticsNotification $ getDocumentEdit doc
81
- liftIO $ contents @?= " main = undefined \n foo = id \n "
85
+ liftIO $ contents @?= expectedContent
82
86
83
87
, testCase " changing configuration enables or disables hints" $ runSession hlsCommand fullCaps " test/testdata/hlint" $ do
84
88
let config = def { hlintOn = True }
@@ -89,7 +93,7 @@ hlintTests = testGroup "hlint suggestions" [
89
93
90
94
liftIO $ length diags @?= 2
91
95
92
- let config' = def { hlintOn = False }
96
+ let config' = def { hlintOn = False }
93
97
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config'))
94
98
95
99
_ <- waitForDiagnosticsSource " typecheck"
You can’t perform that action at this time.
0 commit comments