Skip to content

Commit 3e6378a

Browse files
peterwicksstringfieldjneira
authored andcommitted
Ensure that the testfiles produce at least one diagnostic.
1 parent 56629b1 commit 3e6378a

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ redundantImportTests = testGroup "redundant import code actions" [
276276
-- provides workspace edit property which skips round trip to
277277
-- the server
278278
contents <- documentContents doc
279-
liftIO $ contents @?= "module CodeActionRedundant where\nmain :: IO ()\nmain = putStrLn \"hello\""
279+
liftIO $ contents @?= "{-# OPTIONS_GHC -Wunused-imports #-}\nmodule CodeActionRedundant where\nmain :: IO ()\nmain = putStrLn \"hello\"\n"
280280

281281
, testCase "doesn't touch other imports" $ runSession hlsCommand noLiteralCaps "test/testdata/redundantImportTest/" $ do
282282
doc <- openDoc "src/MultipleImports.hs" "haskell"
@@ -285,7 +285,8 @@ redundantImportTests = testGroup "redundant import code actions" [
285285
executeCommand cmd
286286
contents <- documentContents doc
287287
liftIO $ (T.lines contents) @?=
288-
[ "module MultipleImports where"
288+
[ "{-# OPTIONS_GHC -Wunused-imports #-}"
289+
, "module MultipleImports where"
289290
, "import Data.Maybe"
290291
, "foo :: Int"
291292
, "foo = fromJust (Just 3)"

test/testdata/Highlight.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module Highlight where
22
foo :: Int
33
foo = 3
44
bar = foo
5-
where baz = let x = foo in x
5+
where baz = let x = foo in id x
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
{-# OPTIONS_GHC -Wunused-imports #-}
12
module CodeActionRedundant where
23
import Data.List
34
main :: IO ()
4-
main = putStrLn "hello"
5+
main = putStrLn "hello"

test/testdata/redundantImportTest/src/MultipleImports.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# OPTIONS_GHC -Wunused-imports #-}
12
module MultipleImports where
23
import Data.Foldable
34
import Data.Maybe

0 commit comments

Comments
 (0)