@@ -14,7 +14,7 @@ import qualified Ide.Plugin.Cabal
1414import Ide.Plugin.Cabal.Completion.Types
1515import System.FilePath
1616import Test.Hls
17- import Test.Hls.FileSystem ( VirtualFileTree )
17+ import qualified Test.Hls.FileSystem as FS
1818
1919
2020cabalPlugin :: PluginTestDescriptor Ide.Plugin.Cabal. Log
@@ -52,22 +52,22 @@ runCabalTestCaseSession :: TestName -> FilePath -> Session () -> TestTree
5252runCabalTestCaseSession title subdir = testCase title . runCabalSession subdir
5353
5454runHaskellTestCaseSession :: TestName -> FilePath -> Session () -> TestTree
55- runHaskellTestCaseSession title subdir = testCase title . runHaskellAndCabalSession subdir
55+ runHaskellTestCaseSession title subdir = testCase title . runHaskellAndCabalSession ( FS. mkVirtualFileTree testDataDir [ FS. copyDir subdir])
5656
5757runCabalSession :: FilePath -> Session a -> IO a
5858runCabalSession subdir =
59- failIfSessionTimeout . runSessionWithServer def cabalPlugin (testDataDir </> subdir)
59+ failIfSessionTimeout . runSessionWithServerInTmpDir def cabalPlugin (FS. mkVirtualFileTree testDataDir [ FS. copyDir subdir] )
6060
61- runCabalTestCaseSessionVft :: TestName -> VirtualFileTree -> Session () -> TestTree
61+ runCabalTestCaseSessionVft :: TestName -> FS. VirtualFileTree -> Session () -> TestTree
6262runCabalTestCaseSessionVft title vft = testCase title . runCabalSessionVft vft
6363
64- runCabalSessionVft :: VirtualFileTree -> Session a -> IO a
64+ runCabalSessionVft :: FS. VirtualFileTree -> Session a -> IO a
6565runCabalSessionVft vft =
6666 failIfSessionTimeout . runSessionWithServerInTmpDir def cabalPlugin vft
6767
68- runHaskellAndCabalSession :: FilePath -> Session a -> IO a
69- runHaskellAndCabalSession subdir =
70- failIfSessionTimeout . runSessionWithServer def (cabalPlugin <> cabalHaskellPlugin) (testDataDir </> subdir)
68+ runHaskellAndCabalSession :: FS. VirtualFileTree -> Session a -> IO a
69+ runHaskellAndCabalSession vft =
70+ failIfSessionTimeout . runSessionWithServerInTmpDir def (cabalPlugin <> cabalHaskellPlugin) vft
7171
7272runCabalGoldenSession :: TestName -> FilePath -> FilePath -> (TextDocumentIdentifier -> Session () ) -> TestTree
7373runCabalGoldenSession title subdir fp act = goldenWithCabalDoc def cabalPlugin title testDataDir (subdir </> fp) " golden" " cabal" act
0 commit comments