Commit db3dbefd authored by Simon Marlow's avatar Simon Marlow
Browse files

make this test less sensitive to file descriptor numbers

parent 078d4f83
......@@ -2,6 +2,7 @@
import System.IO
import Control.Exception
import Data.Char
import System.Posix
import qualified GHC.IO.Device as IODevice
......@@ -26,8 +27,12 @@ main = do
hIsOpen hwrite >>= print
showPossibleException :: IO () -> IO ()
showPossibleException f = do e <- try f
print (e :: Either SomeException ())
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
naughtyClose h =
withHandle_ "naughtyClose" h $ \ Handle__{haDevice=dev} -> do
......
Right ()
False
Left <file descriptor: 4>: hClose: resource vanished (Broken pipe)
Left <file descriptor: X>: hClose: resource vanished (Broken pipe)
False
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment