[commit: packages/directory] master: Add test: RenameDirectory (416ec19)

git at git.haskell.org git at git.haskell.org
Tue Apr 19 06:58:00 UTC 2016


Repository : ssh://git@git.haskell.org/directory

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/416ec19c55492bdb4dc3f1a729d7e4286a61a663/directory

>---------------------------------------------------------------

commit 416ec19c55492bdb4dc3f1a729d7e4286a61a663
Author: Phil Ruffwind <rf at rufflewind.com>
Date:   Mon Apr 18 11:57:13 2016 -0400

    Add test: RenameDirectory


>---------------------------------------------------------------

416ec19c55492bdb4dc3f1a729d7e4286a61a663
 directory.cabal          |  1 +
 tests/Main.hs            |  2 ++
 tests/RenameDirectory.hs | 11 +++++++++++
 3 files changed, 14 insertions(+)

diff --git a/directory.cabal b/directory.cabal
index 2c38c12..d4d56da 100644
--- a/directory.cabal
+++ b/directory.cabal
@@ -102,6 +102,7 @@ test-suite test
         GetPermissions001
         IsSymbolicLink
         RemoveDirectoryRecursive001
+        RenameDirectory
         RenameFile001
         Safe
         T8482
diff --git a/tests/Main.hs b/tests/Main.hs
index 65127f6..3a5a02d 100644
--- a/tests/Main.hs
+++ b/tests/Main.hs
@@ -17,6 +17,7 @@ import qualified GetHomeDirectory001
 import qualified GetPermissions001
 import qualified IsSymbolicLink
 import qualified RemoveDirectoryRecursive001
+import qualified RenameDirectory
 import qualified RenameFile001
 import qualified Safe
 import qualified T8482
@@ -41,6 +42,7 @@ main = T.testMain $ \ _t -> do
   T.isolatedRun _t "GetPermissions001" GetPermissions001.main
   T.isolatedRun _t "IsSymbolicLink" IsSymbolicLink.main
   T.isolatedRun _t "RemoveDirectoryRecursive001" RemoveDirectoryRecursive001.main
+  T.isolatedRun _t "RenameDirectory" RenameDirectory.main
   T.isolatedRun _t "RenameFile001" RenameFile001.main
   T.isolatedRun _t "Safe" Safe.main
   T.isolatedRun _t "T8482" T8482.main
diff --git a/tests/RenameDirectory.hs b/tests/RenameDirectory.hs
new file mode 100644
index 0000000..90881a8
--- /dev/null
+++ b/tests/RenameDirectory.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE CPP #-}
+module RenameDirectory where
+#include "util.inl"
+import System.Directory
+
+main :: TestEnv -> IO ()
+main _t = do
+  createDirectory "a"
+  T(expectEq) () ["a"] =<< listDirectory "."
+  renameDirectory "a" "b"
+  T(expectEq) () ["b"] =<< listDirectory "."



More information about the ghc-commits mailing list