1
1
module IfaceTests (tests ) where
2
2
3
+ import Config
3
4
import Control.Monad.IO.Class (liftIO )
4
5
import qualified Data.Text as T
5
6
import Development.IDE.GHC.Util
@@ -17,9 +18,9 @@ import Language.LSP.Test
17
18
import System.Directory
18
19
import System.FilePath
19
20
import System.IO.Extra hiding (withTempDir )
21
+ import Test.Hls.FileSystem (toAbsFp )
20
22
import Test.Tasty
21
23
import Test.Tasty.HUnit
22
- import TestUtils
23
24
24
25
tests :: TestTree
25
26
tests = testGroup " Interface loading tests"
@@ -33,10 +34,10 @@ tests = testGroup "Interface loading tests"
33
34
34
35
-- | test that TH reevaluates across interfaces
35
36
ifaceTHTest :: TestTree
36
- ifaceTHTest = testCase " iface-th-test" $ runWithExtraFiles " TH" $ \ dir -> do
37
- let aPath = dir </> " THA.hs"
38
- bPath = dir </> " THB.hs"
39
- cPath = dir </> " THC.hs"
37
+ ifaceTHTest = testWithExtraFiles " iface-th-test" " TH" $ \ dir -> do
38
+ let aPath = dir `toAbsFp` " THA.hs"
39
+ bPath = dir `toAbsFp` " THB.hs"
40
+ cPath = dir `toAbsFp` " THC.hs"
40
41
41
42
aSource <- liftIO $ readFileUtf8 aPath -- [TH] a :: ()
42
43
_bSource <- liftIO $ readFileUtf8 bPath -- a :: ()
@@ -55,10 +56,10 @@ ifaceTHTest = testCase "iface-th-test" $ runWithExtraFiles "TH" $ \dir -> do
55
56
closeDoc cdoc
56
57
57
58
ifaceErrorTest :: TestTree
58
- ifaceErrorTest = testCase " iface-error-test-1" $ runWithExtraFiles " recomp" $ \ dir -> do
59
+ ifaceErrorTest = testWithExtraFiles " iface-error-test-1" " recomp" $ \ dir -> do
59
60
configureCheckProject True
60
- let bPath = dir </> " B.hs"
61
- pPath = dir </> " P.hs"
61
+ let bPath = dir `toAbsFp` " B.hs"
62
+ pPath = dir `toAbsFp` " P.hs"
62
63
63
64
bSource <- liftIO $ readFileUtf8 bPath -- y :: Int
64
65
pSource <- liftIO $ readFileUtf8 pPath -- bar = x :: Int
@@ -104,9 +105,9 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
104
105
expectNoMoreDiagnostics 2
105
106
106
107
ifaceErrorTest2 :: TestTree
107
- ifaceErrorTest2 = testCase " iface-error-test-2" $ runWithExtraFiles " recomp" $ \ dir -> do
108
- let bPath = dir </> " B.hs"
109
- pPath = dir </> " P.hs"
108
+ ifaceErrorTest2 = testWithExtraFiles " iface-error-test-2" " recomp" $ \ dir -> do
109
+ let bPath = dir `toAbsFp` " B.hs"
110
+ pPath = dir `toAbsFp` " P.hs"
110
111
111
112
bSource <- liftIO $ readFileUtf8 bPath -- y :: Int
112
113
pSource <- liftIO $ readFileUtf8 pPath -- bar = x :: Int
@@ -138,9 +139,9 @@ ifaceErrorTest2 = testCase "iface-error-test-2" $ runWithExtraFiles "recomp" $ \
138
139
expectNoMoreDiagnostics 2
139
140
140
141
ifaceErrorTest3 :: TestTree
141
- ifaceErrorTest3 = testCase " iface-error-test-3" $ runWithExtraFiles " recomp" $ \ dir -> do
142
- let bPath = dir </> " B.hs"
143
- pPath = dir </> " P.hs"
142
+ ifaceErrorTest3 = testWithExtraFiles " iface-error-test-3" " recomp" $ \ dir -> do
143
+ let bPath = dir `toAbsFp` " B.hs"
144
+ pPath = dir `toAbsFp` " P.hs"
144
145
145
146
bSource <- liftIO $ readFileUtf8 bPath -- y :: Int
146
147
pSource <- liftIO $ readFileUtf8 pPath -- bar = x :: Int
0 commit comments