Permalink
Browse files

Change T4113 to follow changes to getCanonicalizePath behaviour

As a side effect, this fixes the T4113 test on OS X
  • Loading branch information...
batterseapower committed Apr 2, 2011
1 parent ed59526 commit 7cd4c9d4f51b2afaf4fb46cfd750e01ec0af226f
Showing with 11 additions and 14 deletions.
  1. +10 −12 tests/ghc-regress/lib/IO/T4113.hs
  2. +1 −2 tests/ghc-regress/lib/IO/T4113.stdout
@@ -6,15 +6,13 @@ 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
-
+main = do
+ cwd <- getCurrentDirectory
+ fp <- canonicalizePath ""
+ print (cwd == fp)
+
+ -- Just make sure we don't fail with missing paths:
+ canonicalizePath "no/such/file"
+ canonicalizePath "/no/such/file"
+
+ return ()
@@ -1,2 +1 @@
-Exception: : canonicalizePath: does not exist (No such file or directory)
-Exception: /no/such/file: canonicalizePath: does not exist (No such file or directory)
+True

0 comments on commit 7cd4c9d

Please sign in to comment.