projects
/
haskell-directory.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1f9af20
)
Make currentDirectory001 not conflict with other tests running in parallel
author
Ian Lynagh
<igloo@earth.li>
Wed, 11 Jun 2008 18:08:44 +0000
(18:08 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Wed, 11 Jun 2008 18:08:44 +0000
(18:08 +0000)
tests/currentDirectory001.hs
patch
|
blob
|
history
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"
+