@@ -5,32 +5,15 @@ import Control.Lens ((^.))
5
5
import Control.Monad.IO.Class
6
6
import qualified Data.Text as T
7
7
import qualified Language.LSP.Protocol.Lens as L
8
- import System.FilePath ((</>) )
9
8
import Test.Hls
10
9
import Test.Hls.Command
11
10
12
-
13
11
tests :: TestTree
14
- tests = testGroup " hie-bios" [
15
- testCase " loads modules inside main-is" $ do
16
- writeFile (hieBiosErrorPath </> " hie.yaml" ) " "
17
- runSession hlsCommand fullCaps " test/testdata/hieBiosMainIs" $ do
18
- doc <- openDoc " Main.hs" " haskell"
19
- Just mainHoverText <- getHover doc (Position 3 1 )
20
- let hoverContents = mainHoverText ^. L. contents
21
- case hoverContents of
22
- (InL (MarkupContent _ x)) -> do
23
- liftIO $ " main :: IO ()" `T.isInfixOf` x
24
- @? " found hover text for main"
25
- _ -> error $ " Unexpected hover contents: " ++ show hoverContents
26
-
27
- , expectFailBecause " hie-bios 0.11 has poor error messages" $ testCase " reports errors in hie.yaml" $ do
28
- writeFile (hieBiosErrorPath </> " hie.yaml" ) " "
29
- runSession hlsCommand fullCaps hieBiosErrorPath $ do
30
- _ <- openDoc " Foo.hs" " haskell"
31
- (diag: _) <- waitForDiagnostics
32
- liftIO $ " Expected a cradle: key containing the preferences" `T.isInfixOf` (diag ^. L. message)
33
- @? " Error reported"
34
- ]
35
- where
36
- hieBiosErrorPath = " test/testdata/hieBiosError"
12
+ tests = testGroup " hie-bios"
13
+ [ testCase " loads main-is module" $ do
14
+ runSession hlsCommand fullCaps " test/testdata/hieBiosMainIs" $ do
15
+ _ <- openDoc " Main.hs" " haskell"
16
+ (diag: _) <- waitForDiagnostics
17
+ liftIO $ " Top-level binding with no type signature:" `T.isInfixOf` (diag ^. L. message)
18
+ @? " Expected missing top-level binding diagnostic"
19
+ ]
0 commit comments