Skip to content

Commit 01121cf

Browse files
Add a debug check to ensure the temp dir exists
1 parent b795bf8 commit 01121cf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test/Streamly/Test/FileSystem/Handle.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
module Streamly.Test.FileSystem.Handle (main) where
1010

11+
import Control.Monad (when)
1112
import Data.Functor.Identity (runIdentity)
1213
import Data.Word (Word8)
1314
import Streamly.Internal.Data.Stream (Stream)
1415
import Streamly.Internal.System.IO (defaultChunkSize)
16+
import System.Directory (doesDirectoryExist)
1517
import System.FilePath ((</>))
1618
import System.IO
1719
( Handle
@@ -70,6 +72,8 @@ testBinData = "01234567890123456789012345678901234567890123456789"
7072
executor :: (Handle -> Stream IO Char) -> IO (Stream IO Char)
7173
executor 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

0 commit comments

Comments
 (0)