[commit: directory] master: Move T4113 to libraries/directory/tests (#4480) (601172f)
Simon Marlow
marlowsd at gmail.com
Wed Dec 14 12:43:23 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/directory
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/601172f9e7eff58bb0986abd0421a5650c27c8ec
>---------------------------------------------------------------
commit 601172f9e7eff58bb0986abd0421a5650c27c8ec
Author: Simon Marlow <marlowsd at gmail.com>
Date: Tue Dec 13 09:40:42 2011 +0000
Move T4113 to libraries/directory/tests (#4480)
>---------------------------------------------------------------
tests/T4113.hs | 20 ++++++++++++++++++++
tests/T4113.stdout | 2 ++
tests/T4113.stdout-i386-unknown-mingw32 | 2 ++
tests/all.T | 2 ++
4 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/tests/T4113.hs b/tests/T4113.hs
new file mode 100644
index 0000000..3bc8096
--- /dev/null
+++ b/tests/T4113.hs
@@ -0,0 +1,20 @@
+
+module Main (main) where
+
+import Control.Exception
+import Prelude hiding (catch)
+import System.Directory
+
+main :: IO ()
+main = do doit ""
+ doit "/no/such/file"
+
+doit :: FilePath -> IO ()
+doit fp = do fp' <- canonicalizePath fp
+ print (fp, mangle fp')
+ `catch` \e -> putStrLn ("Exception: " ++ show (e :: IOException))
+ where -- On Windows, "/no/such/file" -> "C:\\no\\such\\file", so
+ -- we remove the drive letter so as to get consistent output
+ mangle (_ : ':' : xs) = "drive:" ++ xs
+ mangle xs = xs
+
diff --git a/tests/T4113.stdout b/tests/T4113.stdout
new file mode 100644
index 0000000..86a7e9e
--- /dev/null
+++ b/tests/T4113.stdout
@@ -0,0 +1,2 @@
+Exception: : canonicalizePath: does not exist (No such file or directory)
+Exception: /no/such/file: canonicalizePath: does not exist (No such file or directory)
diff --git a/tests/T4113.stdout-i386-unknown-mingw32 b/tests/T4113.stdout-i386-unknown-mingw32
new file mode 100644
index 0000000..16f302c
--- /dev/null
+++ b/tests/T4113.stdout-i386-unknown-mingw32
@@ -0,0 +1,2 @@
+Exception: getFullPathName: invalid argument (The filename, directory name, or volume label syntax is incorrect.)
+("/no/such/file","drive:\\no\\such\\file")
diff --git a/tests/all.T b/tests/all.T
index a25fe2e..c2c3933 100644
--- a/tests/all.T
+++ b/tests/all.T
@@ -22,3 +22,5 @@ test('createDirectoryIfMissing001', normal, compile_and_run, [''])
# No sane way to tell whether the output is reasonable here...
test('getHomeDirectory001', ignore_output, compile_and_run, [''])
+
+test('T4113', normal, compile_and_run, [''])
More information about the Cvs-libraries
mailing list