diff options
Diffstat (limited to 'libraries/base/tests')
-rw-r--r-- | libraries/base/tests/IO/hGetChar001.hs | 15 | ||||
-rw-r--r-- | libraries/base/tests/IO/misc001.hs | 6 | ||||
-rw-r--r-- | libraries/base/tests/IO/newline001.hs | 16 | ||||
-rw-r--r-- | libraries/base/tests/T11334a.hs | 1 | ||||
-rw-r--r-- | libraries/base/tests/T9111.hs | 1 |
5 files changed, 24 insertions, 15 deletions
diff --git a/libraries/base/tests/IO/hGetChar001.hs b/libraries/base/tests/IO/hGetChar001.hs index 776c88eb09..f1cd80e6a2 100644 --- a/libraries/base/tests/IO/hGetChar001.hs +++ b/libraries/base/tests/IO/hGetChar001.hs @@ -10,9 +10,12 @@ main = do where readLine = do eof <- isEOF - if eof then return [] else do - c <- getChar - if c `elem` ['\n','\r'] - then return [] - else do cs <- readLine - return (c:cs) + if eof + then return [] + else do + c <- getChar + if c `elem` ['\n','\r'] + then return [] + else do + cs <- readLine + return (c:cs) diff --git a/libraries/base/tests/IO/misc001.hs b/libraries/base/tests/IO/misc001.hs index 4e0bbecbae..047152ed55 100644 --- a/libraries/base/tests/IO/misc001.hs +++ b/libraries/base/tests/IO/misc001.hs @@ -19,6 +19,6 @@ copyFile h1 h2 = do if eof then return () else do - c <- hGetChar h1 - c <- hPutChar h2 (toUpper c) - copyFile h1 h2 + c <- hGetChar h1 + c <- hPutChar h2 (toUpper c) + copyFile h1 h2 diff --git a/libraries/base/tests/IO/newline001.hs b/libraries/base/tests/IO/newline001.hs index 1c894422a9..a40947921b 100644 --- a/libraries/base/tests/IO/newline001.hs +++ b/libraries/base/tests/IO/newline001.hs @@ -108,14 +108,18 @@ read_chars :: Handle -> IO String read_chars h = loop h "" where loop h acc = do b <- hIsEOF h - if b then return (reverse acc) else do - c <- hGetChar h - loop h (c:acc) + if b + then return (reverse acc) + else do + c <- hGetChar h + loop h (c:acc) read_lines :: Handle -> IO String read_lines h = loop h [] where loop h acc = do b <- hIsEOF h - if b then return (intercalate "\n" (reverse acc)) else do - l <- hGetLine h - loop h (l : acc) + if b + then return (intercalate "\n" (reverse acc)) + else do + l <- hGetLine h + loop h (l : acc) diff --git a/libraries/base/tests/T11334a.hs b/libraries/base/tests/T11334a.hs index ad296967a7..16ca640815 100644 --- a/libraries/base/tests/T11334a.hs +++ b/libraries/base/tests/T11334a.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DataKinds #-} module Main (main) where diff --git a/libraries/base/tests/T9111.hs b/libraries/base/tests/T9111.hs index b2d1716ccd..66e5c4a5e2 100644 --- a/libraries/base/tests/T9111.hs +++ b/libraries/base/tests/T9111.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DataKinds #-} module T9111 where |