We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af3e918 commit 11af036Copy full SHA for 11af036
1 file changed
test/Streamly/Test/Coreutils/Rm.hs
@@ -43,6 +43,7 @@ import System.Directory
43
, createDirectoryLink
44
, createFileLink
45
, doesPathExist
46
+ , getTemporaryDirectory
47
)
48
import System.FilePath ((</>))
49
import System.IO.Temp (createTempDirectory)
@@ -71,9 +72,10 @@ import Streamly.Coreutils.Rm
71
72
73
-- | Run a test inside a fresh temporary directory, cleaning up afterwards.
74
withTempDir :: (FilePath -> IO ()) -> IO ()
-withTempDir action =
75
+withTempDir action = do
76
+ tmpRoot <- getTemporaryDirectory
77
bracket
- (createTempDirectory "/tmp" "rm-test-")
78
+ (createTempDirectory tmpRoot "rm-test-")
79
removePathForcibly'
80
action
81
where
0 commit comments