on 58feee2 help sign in
51 lines 1.8 kB history raw
1-- |
2-- Module : Streamly.Test.FileSystem.Event.Windows
3-- Copyright : (c) 2020 Composewell Technologies
4-- License : BSD-3-Clause
5-- Maintainer : streamly@composewell.com
6-- Stability : experimental
7-- Portability : GHC
8--
9module Streamly.Test.FileSystem.Event.Windows (main) where
11import qualified Streamly.Internal.FileSystem.Event.Windows as Event
12import Streamly.Test.FileSystem.Event.Common
14moduleName :: String
15moduleName = "FileSystem.Event.Windows"
17-- TODO Test isModified event for parent directories when a file is created or
18-- deleted.
20main :: IO ()
21main = do
22 let regularRootTests =
23 commonTests
24 -- The following watch-root deletion test results in:
25 -- C:\tmp\fsevent_dir-e061f0b0a00e1696\watch-root:
26 -- removePathForcibly:RemoveDirectory
27 -- "\\\\?\\C:\\tmp\\fsevent_dir-e061f0b0a00e1696\\watch-root":
28 -- permission denied (The process cannot access the file because it is
29 -- being used by another process.)
30 --
31 -- ++ dirDelete "" (\dir -> [(dir, Event.isDeleted)])
33 let w = Event.watchWith (Event.setAllEvents True)
34 run = runTests moduleName "non-recursive" w
36 run DirType regularRootTests
37 run SymLinkOrigPath commonTests
39 let recTests =
40 [ dirCreateWithParent "subdir\\dir"
41 (\dir -> [(dir, dirEvent Event.isCreated)])
42 , fileCreateWithParent "subdir\\file"
43 (\file -> [(file, fileEvent Event.isCreated)])
44 ] ++ commonRecTests
46 let recw = Event.watchWith
47 (Event.setAllEvents True . Event.setRecursiveMode True)
48 runRec = runTests moduleName "recursive" recw
50 runRec DirType (regularRootTests ++ recTests)
51 runRec SymLinkOrigPath (commonTests ++ recTests)