From 91d6a82800ce5fd57d3f776b8265e9242cf1b174 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 11 Jun 2008 18:08:44 +0000 Subject: [PATCH] Make currentDirectory001 not conflict with other tests running in parallel --- tests/currentDirectory001.hs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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" + -- 1.7.10.4