Skip to content

Commit 132a662

Browse files
committed
Add a failing test for haskell#2032
1 parent 2fef041 commit 132a662

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

plugins/hls-pragmas-plugin/test/Main.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ codeActionTests =
123123
cas <- map fromAction <$> getAllCodeActions doc
124124
liftIO $ "Disable \"unused-imports\" warnings" `elem` map (^. L.title) cas @? "Contains unused-imports code action"
125125
executeCodeAction $ head cas
126+
127+
, goldenWithPragmas "doesn't suggest disabling type errors" "DeferredTypeErrors" $ \doc -> do
128+
129+
_ <- waitForDiagnosticsFrom doc
130+
cas <- map fromAction <$> getAllCodeActions doc
131+
liftIO $ "Disable \"deferred-type-errors\" warnings" `notElem` map (^. L.title) cas @? "Doesn't contain deferred-type-errors code action"
132+
liftIO $ length cas == 0 @? "Expected no code actions, but got: " <> show cas
126133
]
127134

128135
completionTests :: TestTree
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module DeferredTypeErrors where
2+
3+
foo :: Int
4+
foo = ()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module DeferredTypeErrors where
2+
3+
foo :: Int
4+
foo = ()

0 commit comments

Comments
 (0)