Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
Add cradle to watched files test
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Jun 16, 2020
1 parent 9ad9fba commit 23b1776
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -491,21 +491,23 @@ watchedFilesTests = testGroup "watched files"
watchedFileRegs <- getWatchedFilesSubscriptionsUntil @PublishDiagnosticsNotification

-- Expect 4 subscriptions (A does not get any because it's VFS):
-- - /path-to-workspace/hie.yaml
-- - /path-to-workspace/WatchedFilesMissingModule.hs
-- - /path-to-workspace/WatchedFilesMissingModule.lhs
-- - /path-to-workspace/src/WatchedFilesMissingModule.hs
-- - /path-to-workspace/src/WatchedFilesMissingModule.lhs
liftIO $ length watchedFileRegs @?= 4
liftIO $ length watchedFileRegs @?= 5

, testSession' "non workspace file" $ \sessionDir -> do
liftIO $ writeFile (sessionDir </> "hie.yaml") "cradle: {direct: {arguments: [\"-i/tmp\"]}}"
_doc <- createDoc "A.hs" "haskell" "{-# LANGUAGE NoImplicitPrelude#-}\nmodule A where\nimport WatchedFilesMissingModule"
watchedFileRegs <- getWatchedFilesSubscriptionsUntil @PublishDiagnosticsNotification

-- Expect 2 subscriptions (/tmp does not get any as it is out of the workspace):
-- - /path-to-workspace/hie.yaml
-- - /path-to-workspace/WatchedFilesMissingModule.hs
-- - /path-to-workspace/WatchedFilesMissingModule.lhs
liftIO $ length watchedFileRegs @?= 2
liftIO $ length watchedFileRegs @?= 3

-- TODO add a test for didChangeWorkspaceFolder
]
Expand Down

0 comments on commit 23b1776

Please sign in to comment.