File tree Expand file tree Collapse file tree
test/Streamly/Test/FileSystem Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99module Streamly.Test.FileSystem.Handle (main ) where
1010
11+ import Control.Monad (when )
1112import Data.Functor.Identity (runIdentity )
1213import Data.Word (Word8 )
1314import Streamly.Internal.Data.Stream (Stream )
1415import Streamly.Internal.System.IO (defaultChunkSize )
16+ import System.Directory (doesDirectoryExist )
1517import System.FilePath ((</>) )
1618import System.IO
1719 ( Handle
@@ -70,6 +72,8 @@ testBinData = "01234567890123456789012345678901234567890123456789"
7072executor :: (Handle -> Stream IO Char ) -> IO (Stream IO Char )
7173executor f =
7274 withSystemTempDirectory " fs_handle" $ \ fp -> do
75+ r <- doesDirectoryExist fp
76+ when (not r) $ error $ " temp directory [" ++ fp ++ " ] does not exist"
7377 let path = fp </> " tmp_read.txt"
7478 putStrLn $ " executor: [" ++ path ++ " ]"
7579 fpath <- Path. fromString path
You can’t perform that action at this time.
0 commit comments