2-- Module : Streamly.Test.FileSystem.Event.Darwin
3-- Copyright : (c) 2020 Composewell Technologies
4-- License : BSD-3-Clause
5-- Maintainer : streamly@composewell.com
6-- Stability : experimental
9module Streamly.Test.FileSystem.Event.Darwin (main) where
11import qualified Streamly.Internal.FileSystem.Event.Darwin as Event
13import Streamly.Test.FileSystem.Event.Common
16moduleName = "FileSystem.Event.Darwin"
19-- Creation/deletion/move of hard links
20-- Deletion of last hard link
21-- If a directory is a symlink is it followed in recursive mode?
25 let symLinkRootTests =
26 dirCreateWithParent "subdir/dir"
27 (\dir -> [(dir, dirEvent Event.isCreated)])
28 : fileCreateWithParent "subdir/file"
30 [ (file, fileEvent Event.isCreated)
31 , (file, fileEvent Event.isAttrsModified)
34 : fileCreate "file-create-attrs"
36 [ (file, fileEvent Event.isCreated)
37 , (file, fileEvent Event.isAttrsModified)
42 (\file -> [(file, fileEvent Event.isAttrsModified)])
43 : dirDelete "dir-sec" (\dir ->
44 [ (dir, dirEvent Event.isDeleted)
45 , (dir, dirEvent Event.isSecurityModified)
50 let regularRootTests =
52 [ (dir, dirEvent Event.isDeleted)
53 , (dir, dirEvent Event.isSecurityModified)
54 , (dir, Event.isRootPathEvent)
57 -- The watch root create event always seems to come even though the
58 -- root is created before the watch is started. That may be because
60 -- XXX Need to create watch root after adding the watch, otherwise
61 -- it fails intermittently.
62 -- : dirCreate "" (\dir -> [(dir, dirEvent Event.isCreated)])
63 : rootDirMove "moved" (\src ->
64 [ (src, Event.isRootPathEvent)
65 , (src, Event.isMoved)
70 [ fileDelete "" (\path ->
71 [ (path, Event.isRootPathEvent)
72 , (path, Event.isDeleted)
74 , rootFileMove "moved" (\path ->
75 [(path, Event.isRootPathEvent)
76 , (path, Event.isMoved)
78 , fileModify "" (const [])
81 let w = Event.watchWith (Event.setAllEvents True)
82 run = runTests moduleName "recursive" w
84 run DirType regularRootTests
85 run SymLinkResolvedPath symLinkRootTests
86 run FileType fileRootTests
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list