4
4
5
5
module DependentFileTest (tests ) where
6
6
7
+ import Config
7
8
import Control.Monad.IO.Class (liftIO )
8
9
import Data.Row
9
10
import qualified Data.Text as T
@@ -16,19 +17,19 @@ import Language.LSP.Protocol.Types hiding
16
17
SemanticTokensEdit (.. ),
17
18
mkRange )
18
19
import Language.LSP.Test
19
- import System.FilePath
20
+ import Test.Hls.FileSystem ( FileSystem , toAbsFp )
20
21
import Test.Tasty
21
- import TestUtils
22
22
23
23
tests :: TestTree
24
24
tests = testGroup " addDependentFile"
25
- [testGroup " file-changed" [testSession ' " test" test]
25
+ [testGroup " file-changed" [testWithDummyPlugin ' " test" (mkIdeTestFs [] ) test]
26
26
]
27
27
where
28
+ test :: FileSystem -> Session ()
28
29
test dir = do
29
30
-- If the file contains B then no type error
30
31
-- otherwise type error
31
- let depFilePath = dir </> " dep-file.txt"
32
+ let depFilePath = toAbsFp dir " dep-file.txt"
32
33
liftIO $ writeFile depFilePath " A"
33
34
let fooContent = T. unlines
34
35
[ " {-# LANGUAGE TemplateHaskell #-}"
@@ -41,7 +42,7 @@ tests = testGroup "addDependentFile"
41
42
, " if f == \" B\" then [| 1 |] else lift f)"
42
43
]
43
44
let bazContent = T. unlines [" module Baz where" , " import Foo ()" ]
44
- _ <- createDoc " Foo.hs" " haskell" fooContent
45
+ _fooDoc <- createDoc " Foo.hs" " haskell" fooContent
45
46
doc <- createDoc " Baz.hs" " haskell" bazContent
46
47
expectDiagnostics
47
48
[(" Foo.hs" , [(DiagnosticSeverity_Error , (4 ,11 ), " Couldn't match type" )])]
0 commit comments