1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad
import qualified Data.ByteString as B
import System.INotify as INotify
import Utils
write :: FilePath -> IO ()
write path =
B.writeFile (path ++ "/hello") ""
-- actually writing any contents gives me two Modified
main :: IO ()
main =
inTestEnviron [AllEvents] write $ \ events -> do
when (expected ~= events)
testSuccess
putStrLn $ explainFailure expected events
testFailure
expected :: [Event]
expected =
[ Created False "hello"
, Opened False (Just "hello")
, Modified False (Just "hello")
, Closed False (Just "hello") True
]
|