File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,9 @@ hlintTests = testGroup "hlint suggestions" [
157
157
testCase " hlint diagnostics ignore hints honouring HLINT annotations" $ runHlintSession " " $ do
158
158
doc <- openDoc " ApplyRefact5.hs" " haskell"
159
159
expectNoMoreDiagnostics 3 doc " hlint"
160
+
161
+ , testCase " apply-refact preserve regular comments" $ runHlintSession " " $ do
162
+ testRefactor " ApplyRefact6.hs" " Redundant bracket" expectedComments
160
163
]
161
164
where
162
165
runHlintSession :: FilePath -> Session a -> IO a
@@ -191,6 +194,14 @@ hlintTests = testGroup "hlint suggestions" [
191
194
, " g = 2"
192
195
, " #endif" , " "
193
196
]
197
+ expectedComments = [ " -- comment before header"
198
+ , " module ApplyRefact6 where" , " "
199
+ , " {-# standalone annotation #-}" , " "
200
+ , " -- standalone comment" , " "
201
+ , " -- | haddock comment"
202
+ , " f = {- inline comment -} 1 -- ending comment" , " "
203
+ , " -- final comment"
204
+ ]
194
205
195
206
renameTests :: TestTree
196
207
renameTests = testGroup " rename suggestions" [
Original file line number Diff line number Diff line change
1
+ -- comment before header
2
+ module ApplyRefact6 where
3
+
4
+ {-# standalone annotation #-}
5
+
6
+ -- standalone comment
7
+
8
+ -- | haddock comment
9
+ f = {- inline comment -} (1 ) -- ending comment
10
+
11
+ -- final comment
Original file line number Diff line number Diff line change 8
8
- " ApplyRefact3"
9
9
- " ApplyRefact4"
10
10
- " ApplyRefact5"
11
+ - " ApplyRefact6"
You can’t perform that action at this time.
0 commit comments