11module IfaceTests (tests ) where
22
3+ import Config
34import Control.Monad.IO.Class (liftIO )
45import qualified Data.Text as T
56import Development.IDE.GHC.Util
@@ -17,9 +18,9 @@ import Language.LSP.Test
1718import System.Directory
1819import System.FilePath
1920import System.IO.Extra hiding (withTempDir )
21+ import Test.Hls.FileSystem (toAbsFp )
2022import Test.Tasty
2123import Test.Tasty.HUnit
22- import TestUtils
2324
2425tests :: TestTree
2526tests = testGroup " Interface loading tests"
@@ -33,10 +34,10 @@ tests = testGroup "Interface loading tests"
3334
3435-- | test that TH reevaluates across interfaces
3536ifaceTHTest :: 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"
4041
4142 aSource <- liftIO $ readFileUtf8 aPath -- [TH] a :: ()
4243 _bSource <- liftIO $ readFileUtf8 bPath -- a :: ()
@@ -55,10 +56,10 @@ ifaceTHTest = testCase "iface-th-test" $ runWithExtraFiles "TH" $ \dir -> do
5556 closeDoc cdoc
5657
5758ifaceErrorTest :: TestTree
58- ifaceErrorTest = testCase " iface-error-test-1" $ runWithExtraFiles " recomp" $ \ dir -> do
59+ ifaceErrorTest = testWithExtraFiles " iface-error-test-1" " recomp" $ \ dir -> do
5960 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"
6263
6364 bSource <- liftIO $ readFileUtf8 bPath -- y :: Int
6465 pSource <- liftIO $ readFileUtf8 pPath -- bar = x :: Int
@@ -104,9 +105,9 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
104105 expectNoMoreDiagnostics 2
105106
106107ifaceErrorTest2 :: 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"
110111
111112 bSource <- liftIO $ readFileUtf8 bPath -- y :: Int
112113 pSource <- liftIO $ readFileUtf8 pPath -- bar = x :: Int
@@ -138,9 +139,9 @@ ifaceErrorTest2 = testCase "iface-error-test-2" $ runWithExtraFiles "recomp" $ \
138139 expectNoMoreDiagnostics 2
139140
140141ifaceErrorTest3 :: 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"
144145
145146 bSource <- liftIO $ readFileUtf8 bPath -- y :: Int
146147 pSource <- liftIO $ readFileUtf8 pPath -- bar = x :: Int
0 commit comments