From: Ian Lynagh Date: Wed, 11 Jun 2008 18:08:44 +0000 (+0000) Subject: Make currentDirectory001 not conflict with other tests running in parallel X-Git-Tag: 6_10_branch_has_been_forked~14 X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=commitdiff_plain;h=91d6a82800ce5fd57d3f776b8265e9242cf1b174 Make currentDirectory001 not conflict with other tests running in parallel --- diff --git a/tests/currentDirectory001.hs b/tests/currentDirectory001.hs index d8ca7b3..0b57a44 100644 --- a/tests/currentDirectory001.hs +++ b/tests/currentDirectory001.hs @@ -1,15 +1,18 @@ -import System.Directory (getCurrentDirectory, setCurrentDirectory, - createDirectory, removeDirectory, getDirectoryContents) +import System.Directory (getCurrentDirectory, setCurrentDirectory, + createDirectory, removeDirectory, + getDirectoryContents) + +main :: IO () main = do oldpwd <- getCurrentDirectory - createDirectory "foo" - setCurrentDirectory "foo" + createDirectory dir + setCurrentDirectory dir ~[n1, n2] <- getDirectoryContents "." if dot n1 && dot n2 then do setCurrentDirectory oldpwd - removeDirectory "foo" + removeDirectory dir putStr "Okay\n" else ioError (userError "Oops") @@ -18,3 +21,7 @@ dot :: String -> Bool dot "." = True dot ".." = True dot _ = False + +dir :: FilePath +dir = "currentDirectory001-dir" +