[commit: testsuite] master: cope with multi-digit file descriptors (#5066) (98e32af)
Simon Marlow
marlowsd at gmail.com
Mon Apr 4 15:50:17 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/98e32af0502ac0bbd2836b0cacf7007126676ab1
>---------------------------------------------------------------
commit 98e32af0502ac0bbd2836b0cacf7007126676ab1
Author: Simon Marlow <marlowsd at gmail.com>
Date: Fri Apr 1 12:13:59 2011 +0100
cope with multi-digit file descriptors (#5066)
Thanks to altaic for the patch.
>---------------------------------------------------------------
tests/ghc-regress/lib/IO/hClose003.hs | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tests/ghc-regress/lib/IO/hClose003.hs b/tests/ghc-regress/lib/IO/hClose003.hs
index 30566cb..cbaf49d 100644
--- a/tests/ghc-regress/lib/IO/hClose003.hs
+++ b/tests/ghc-regress/lib/IO/hClose003.hs
@@ -31,8 +31,11 @@ showPossibleException f = do
e <- try f
putStrLn (sanitise (show (e :: Either SomeException ())))
where
- sanitise = map (\c -> if isDigit c then 'X' else c)
-- we don't care which file descriptor it is
+ sanitise [] = []
+ sanitise (x:xs) = if isDigit x then ('X':(sanitise' xs)) else (x:(sanitise xs))
+ sanitise' [] = []
+ sanitise' (x:xs) = if isDigit x then (sanitise' xs) else (x:(sanitise xs))
naughtyClose h =
withHandle_ "naughtyClose" h $ \ Handle__{haDevice=dev} -> do
More information about the Cvs-ghc
mailing list