Repository : ssh://darcs.haskell.org//srv/darcs/testsuite On branch : master
http://hackage.haskell.org/trac/ghc/changeset/4f2b7e06560d6b03992c862339c6e4502c1aa001 >--------------------------------------------------------------- commit 4f2b7e06560d6b03992c862339c6e4502c1aa001 Author: Ian Lynagh <[email protected]> Date: Fri Jun 10 21:03:37 2011 +0100 Tweak test 3307 >--------------------------------------------------------------- tests/ghc-regress/lib/IO/3307.hs | 6 ++++++ tests/ghc-regress/lib/IO/3307.stdout | 4 ++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/tests/ghc-regress/lib/IO/3307.hs b/tests/ghc-regress/lib/IO/3307.hs index a39bfed..6e9cc8f 100644 --- a/tests/ghc-regress/lib/IO/3307.hs +++ b/tests/ghc-regress/lib/IO/3307.hs @@ -10,22 +10,28 @@ import Data.List import GHC.IO.Encoding main = do + hSetBuffering stdout NoBuffering + -- 1) A file name arriving via an argument + putStrLn "Test 1" [file] <- getArgs readFile file >>= putStr -- 2) A file name arriving via getDirectoryContents + putStrLn "Test 2" [file] <- fmap (filter ("chinese-file-" `isPrefixOf`)) $ getDirectoryContents "." readFile file >>= putStr -- 3) A file name occurring literally in the program -- This will only work if we are in the UTF-8 locale since the file is created -- on disk with a UTF-8 file name. + putStrLn "Test 3" readFile "chinese-file-å°è¯´" >>= putStr -- 4) A file name arriving via another file. -- In this case we have to override the default encoding -- so we get surrogate bytes for non-decodable namse. + putStrLn "Test 4" (readFileAs fileSystemEncoding "chinese-name" >>= (readFile . dropTrailingSpace)) >>= putStr readFileAs :: TextEncoding -> FilePath -> IO String diff --git a/tests/ghc-regress/lib/IO/3307.stdout b/tests/ghc-regress/lib/IO/3307.stdout index f807e10..da8b2f9 100644 --- a/tests/ghc-regress/lib/IO/3307.stdout +++ b/tests/ghc-regress/lib/IO/3307.stdout @@ -1,4 +1,8 @@ +Test 1 Ni hao +Test 2 Ni hao +Test 3 Ni hao +Test 4 Ni hao
_______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
