From 1a8b04eeb31dcfc61fb0e67f41d5f68ed079d9be Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 29 May 2024 19:08:57 +0800 Subject: [PATCH] Migrate WatchedFileTests --- ghcide/test/exe/WatchedFileTests.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ghcide/test/exe/WatchedFileTests.hs b/ghcide/test/exe/WatchedFileTests.hs index 8ae8d8943d..a4683ecbc4 100644 --- a/ghcide/test/exe/WatchedFileTests.hs +++ b/ghcide/test/exe/WatchedFileTests.hs @@ -3,6 +3,7 @@ module WatchedFileTests (tests) where +import Config (testWithDummyPluginEmpty') import Control.Applicative.Combinators import Control.Monad.IO.Class (liftIO) import qualified Data.Aeson as A @@ -19,12 +20,11 @@ import System.Directory import System.FilePath import Test.Tasty import Test.Tasty.HUnit -import TestUtils tests :: TestTree tests = testGroup "watched files" [ testGroup "Subscriptions" - [ testSession' "workspace files" $ \sessionDir -> do + [ testWithDummyPluginEmpty' "workspace files" $ \sessionDir -> do liftIO $ writeFile (sessionDir "hie.yaml") "cradle: {direct: {arguments: [\"-isrc\", \"A\", \"WatchedFilesMissingModule\"]}}" _doc <- createDoc "A.hs" "haskell" "{-#LANGUAGE NoImplicitPrelude #-}\nmodule A where\nimport WatchedFilesMissingModule" setIgnoringRegistrationRequests False @@ -33,7 +33,7 @@ tests = testGroup "watched files" -- Expect 2 subscriptions: one for all .hs files and one for the hie.yaml cradle liftIO $ length watchedFileRegs @?= 2 - , testSession' "non workspace file" $ \sessionDir -> do + , testWithDummyPluginEmpty' "non workspace file" $ \sessionDir -> do tmpDir <- liftIO getTemporaryDirectory let yaml = "cradle: {direct: {arguments: [\"-i" <> tail(init(show tmpDir)) <> "\", \"A\", \"WatchedFilesMissingModule\"]}}" liftIO $ writeFile (sessionDir "hie.yaml") yaml @@ -48,7 +48,7 @@ tests = testGroup "watched files" ] , testGroup "Changes" [ - testSession' "workspace files" $ \sessionDir -> do + testWithDummyPluginEmpty' "workspace files" $ \sessionDir -> do liftIO $ writeFile (sessionDir "hie.yaml") "cradle: {direct: {arguments: [\"-isrc\", \"A\", \"B\"]}}" liftIO $ writeFile (sessionDir "B.hs") $ unlines ["module B where"