projects
/
haskell-directory.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make currentDirectory001 not conflict with other tests running in parallel
[haskell-directory.git]
/
tests
/
currentDirectory001.hs
diff --git
a/tests/currentDirectory001.hs
b/tests/currentDirectory001.hs
index
d8ca7b3
..
0b57a44
100644
(file)
--- 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
main = do
oldpwd <- getCurrentDirectory
- createDirectory "foo"
- setCurrentDirectory "foo"
+ createDirectory dir
+ setCurrentDirectory dir
~[n1, n2] <- getDirectoryContents "."
if dot n1 && dot n2
then do
setCurrentDirectory oldpwd
~[n1, n2] <- getDirectoryContents "."
if dot n1 && dot n2
then do
setCurrentDirectory oldpwd
- removeDirectory "foo"
+ removeDirectory dir
putStr "Okay\n"
else
ioError (userError "Oops")
putStr "Okay\n"
else
ioError (userError "Oops")
@@
-18,3
+21,7
@@
dot :: String -> Bool
dot "." = True
dot ".." = True
dot _ = False
dot "." = True
dot ".." = True
dot _ = False
+
+dir :: FilePath
+dir = "currentDirectory001-dir"
+