diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-18 22:44:19 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-20 16:22:07 +0200 |
commit | a7160faafd44d64c2b20a4cc65e80136a93e1aaa (patch) | |
tree | c0fa999a4696a5a05e861b0eacfcd92358d77a48 /libraries/base/tests | |
parent | 5b03dc69389dc387b922c589ab9a8b92079e6a96 (diff) | |
download | haskell-a7160faafd44d64c2b20a4cc65e80136a93e1aaa.tar.gz |
Testsuite: tabs -> spaces [skip ci]
Diffstat (limited to 'libraries/base/tests')
27 files changed, 189 insertions, 189 deletions
diff --git a/libraries/base/tests/IO/hGetBuf001.hs b/libraries/base/tests/IO/hGetBuf001.hs index eea599ea74..3ca83f1e31 100644 --- a/libraries/base/tests/IO/hGetBuf001.hs +++ b/libraries/base/tests/IO/hGetBuf001.hs @@ -14,16 +14,16 @@ main = do -- test should run quickly, but arrange to kill it if it hangs for any reason: main_t <- myThreadId forkIO $ do - threadDelay 10000000 - throwTo main_t (ErrorCall "killed") + threadDelay 10000000 + throwTo main_t (ErrorCall "killed") - zipWithM_ ($) - [ f rbuf wbuf - | f <- [hGetBufTest, hGetBufNBTest, hGetBufSomeTest], - rbuf <- [buf1,buf2,buf3], - wbuf <- [buf1,buf2,buf3] - ] - [1..] + zipWithM_ ($) + [ f rbuf wbuf + | f <- [hGetBufTest, hGetBufNBTest, hGetBufSomeTest], + rbuf <- [buf1,buf2,buf3], + wbuf <- [buf1,buf2,buf3] + ] + [1..] msg = "hello!" msg_length = length msg @@ -66,13 +66,13 @@ readProc m1 m2 finished h = do let loop 0 = return () loop n = do putMVar m2 (); takeMVar m1 - r <- hGetBuf h buf msg_length - if (r /= msg_length) - then do hPutStr stderr ("error: " ++ show r) - exitFailure - else do s <- peekCStringLen (buf,r) - hPutStr stdout (show n ++ " ") - loop (n-1) + r <- hGetBuf h buf msg_length + if (r /= msg_length) + then do hPutStr stderr ("error: " ++ show r) + exitFailure + else do s <- peekCStringLen (buf,r) + hPutStr stdout (show n ++ " ") + loop (n-1) loop 100 hPutStr stdout "\n" putMVar m2 (); takeMVar m1 @@ -90,12 +90,12 @@ writeProc m1 m2 h = do let loop 0 = return () loop n = - withCStringLen msg $ \ (s,len) -> do - takeMVar m2 - hPutBuf h s len - hFlush h - putMVar m1 () - loop (n-1) + withCStringLen msg $ \ (s,len) -> do + takeMVar m2 + hPutBuf h s len + hFlush h + putMVar m1 () + loop (n-1) loop 100 takeMVar m2 @@ -134,13 +134,13 @@ readProcNB m1 m2 finished h = do let loop 0 = return () loop n = do putMVar m2 (); takeMVar m1 - r <- hGetBufNonBlocking h buf read_size - if (r /= msg_length) - then do hPutStr stderr ("error: " ++ show r) - exitFailure - else do s <- peekCStringLen (buf,r) - hPutStr stdout (show n ++ " ") - loop (n-1) + r <- hGetBufNonBlocking h buf read_size + if (r /= msg_length) + then do hPutStr stderr ("error: " ++ show r) + exitFailure + else do s <- peekCStringLen (buf,r) + hPutStr stdout (show n ++ " ") + loop (n-1) loop 100 hPutStr stdout "\n" putMVar m2 (); takeMVar m1 @@ -158,12 +158,12 @@ writeProcNB m1 m2 h = do let loop 0 = return () loop n = - withCStringLen msg $ \ (s,len) -> do - takeMVar m2 - hPutBufNonBlocking h s len - hFlush h - putMVar m1 () - loop (n-1) + withCStringLen msg $ \ (s,len) -> do + takeMVar m2 + hPutBufNonBlocking h s len + hFlush h + putMVar m1 () + loop (n-1) loop 100 takeMVar m2 @@ -198,13 +198,13 @@ readProcSome m1 m2 finished h = do let loop 0 = return () loop n = do putMVar m2 (); takeMVar m1 - r <- hGetBufSome h buf read_size - if (r /= msg_length) - then do hPutStr stderr ("error: " ++ show r) - exitFailure - else do s <- peekCStringLen (buf,r) - hPutStr stdout (show n ++ " ") - loop (n-1) + r <- hGetBufSome h buf read_size + if (r /= msg_length) + then do hPutStr stderr ("error: " ++ show r) + exitFailure + else do s <- peekCStringLen (buf,r) + hPutStr stdout (show n ++ " ") + loop (n-1) loop 100 hPutStr stdout "\n" putMVar m2 (); takeMVar m1 diff --git a/libraries/base/tests/IO/hGetChar001.hs b/libraries/base/tests/IO/hGetChar001.hs index f5ca666828..776c88eb09 100644 --- a/libraries/base/tests/IO/hGetChar001.hs +++ b/libraries/base/tests/IO/hGetChar001.hs @@ -12,7 +12,7 @@ main = do eof <- isEOF if eof then return [] else do c <- getChar - if c `elem` ['\n','\r'] - then return [] + if c `elem` ['\n','\r'] + then return [] else do cs <- readLine return (c:cs) diff --git a/libraries/base/tests/IO/hGetLine003.hs b/libraries/base/tests/IO/hGetLine003.hs index cc03c604aa..5db29f48ad 100644 --- a/libraries/base/tests/IO/hGetLine003.hs +++ b/libraries/base/tests/IO/hGetLine003.hs @@ -2,8 +2,8 @@ import System.IO main = f stdin where f h = do p <- hIsEOF h - if p then putStrLn "done" - else do l <- hGetLine h - putStrLn l - f h + if p then putStrLn "done" + else do l <- hGetLine h + putStrLn l + f h diff --git a/libraries/base/tests/IO/hGetPosn001.hs b/libraries/base/tests/IO/hGetPosn001.hs index 0a1a39b725..987936fd0d 100644 --- a/libraries/base/tests/IO/hGetPosn001.hs +++ b/libraries/base/tests/IO/hGetPosn001.hs @@ -25,4 +25,4 @@ copy :: Handle -> Handle -> IO () copy hIn hOut = tryIOError (hGetChar hIn) >>= either (\ err -> if isEOFError err then return () else error "copy") - ( \ x -> hPutChar hOut x >> copy hIn hOut) + ( \ x -> hPutChar hOut x >> copy hIn hOut) diff --git a/libraries/base/tests/IO/hSetBuffering002.hs b/libraries/base/tests/IO/hSetBuffering002.hs index 3f553029da..121afff393 100644 --- a/libraries/base/tests/IO/hSetBuffering002.hs +++ b/libraries/base/tests/IO/hSetBuffering002.hs @@ -1,6 +1,6 @@ import System.IO -main = - hSetBuffering stdin NoBuffering >> - hSetBuffering stdout NoBuffering >> +main = + hSetBuffering stdin NoBuffering >> + hSetBuffering stdout NoBuffering >> interact id diff --git a/libraries/base/tests/IO/hSetBuffering002.stdout b/libraries/base/tests/IO/hSetBuffering002.stdout index 3f553029da..121afff393 100644 --- a/libraries/base/tests/IO/hSetBuffering002.stdout +++ b/libraries/base/tests/IO/hSetBuffering002.stdout @@ -1,6 +1,6 @@ import System.IO -main = - hSetBuffering stdin NoBuffering >> - hSetBuffering stdout NoBuffering >> +main = + hSetBuffering stdin NoBuffering >> + hSetBuffering stdout NoBuffering >> interact id diff --git a/libraries/base/tests/IO/ioeGetErrorString001.hs b/libraries/base/tests/IO/ioeGetErrorString001.hs index 361ae62437..538062ea9a 100644 --- a/libraries/base/tests/IO/ioeGetErrorString001.hs +++ b/libraries/base/tests/IO/ioeGetErrorString001.hs @@ -8,6 +8,6 @@ main = do h <- openFile "ioeGetErrorString001.hs" ReadMode hSeek h SeekFromEnd 0 (hGetChar h >> return ()) `catchIOError` - \e -> if isEOFError e - then print (ioeGetErrorString e) - else putStrLn "failed." + \e -> if isEOFError e + then print (ioeGetErrorString e) + else putStrLn "failed." diff --git a/libraries/base/tests/IO/ioeGetFileName001.hs b/libraries/base/tests/IO/ioeGetFileName001.hs index 410093f027..030126c90d 100644 --- a/libraries/base/tests/IO/ioeGetFileName001.hs +++ b/libraries/base/tests/IO/ioeGetFileName001.hs @@ -7,6 +7,6 @@ main = do h <- openFile "ioeGetFileName001.hs" ReadMode hSeek h SeekFromEnd 0 (hGetChar h >> return ()) `catchIOError` - \e -> if isEOFError e - then print (ioeGetFileName e) - else putStrLn "failed." + \e -> if isEOFError e + then print (ioeGetFileName e) + else putStrLn "failed." diff --git a/libraries/base/tests/IO/ioeGetHandle001.hs b/libraries/base/tests/IO/ioeGetHandle001.hs index 1f9c22e20d..08934468e4 100644 --- a/libraries/base/tests/IO/ioeGetHandle001.hs +++ b/libraries/base/tests/IO/ioeGetHandle001.hs @@ -8,6 +8,6 @@ main = do h <- openFile "ioeGetHandle001.hs" ReadMode hSeek h SeekFromEnd 0 (hGetChar h >> return ()) `catchIOError` - \e -> if isEOFError e && fromJust (ioeGetHandle e) == h - then putStrLn "ok." - else putStrLn "failed." + \e -> if isEOFError e && fromJust (ioeGetHandle e) == h + then putStrLn "ok." + else putStrLn "failed." diff --git a/libraries/base/tests/IO/misc001.hs b/libraries/base/tests/IO/misc001.hs index 9f9f3e98d0..4e0bbecbae 100644 --- a/libraries/base/tests/IO/misc001.hs +++ b/libraries/base/tests/IO/misc001.hs @@ -16,9 +16,9 @@ main = do copyFile h1 h2 = do eof <- hIsEOF h1 - if eof - then return () - else do + if eof + then return () + else do c <- hGetChar h1 c <- hPutChar h2 (toUpper c) copyFile h1 h2 diff --git a/libraries/base/tests/IO/openFile001.hs b/libraries/base/tests/IO/openFile001.hs index f34f093d38..1a4339c021 100644 --- a/libraries/base/tests/IO/openFile001.hs +++ b/libraries/base/tests/IO/openFile001.hs @@ -6,6 +6,6 @@ import System.IO.Error main = do hIn <- openFile "openFile001.hs" ReadMode hPutStr hIn "test" `catchIOError` \ err -> - if isIllegalOperation err - then putStrLn "ok." - else error "Oh dear\n" + if isIllegalOperation err + then putStrLn "ok." + else error "Oh dear\n" diff --git a/libraries/base/tests/IO/openFile004.hs b/libraries/base/tests/IO/openFile004.hs index 4124abb0de..2a6b8cc7cf 100644 --- a/libraries/base/tests/IO/openFile004.hs +++ b/libraries/base/tests/IO/openFile004.hs @@ -17,7 +17,7 @@ main = do h <- openFile file ReadMode let loop = do - b <- hIsEOF h - if b then return () - else do c <- hGetChar h; putChar c; loop + b <- hIsEOF h + if b then return () + else do c <- hGetChar h; putChar c; loop loop diff --git a/libraries/base/tests/IO/readwrite002.hs b/libraries/base/tests/IO/readwrite002.hs index 4623f430a9..37c7da39cb 100644 --- a/libraries/base/tests/IO/readwrite002.hs +++ b/libraries/base/tests/IO/readwrite002.hs @@ -1,4 +1,4 @@ --- !!! Testing RW handles +-- !!! Testing RW handles import System.IO import System.IO.Error @@ -39,10 +39,10 @@ speakString = "##############################\n" speak cd = do (do ready <- hReady cd - if ready then - hGetChar cd >>= putChar - else - return () + if ready then + hGetChar cd >>= putChar + else + return () ready <- hReady stdin if ready then (do { ch <- getChar; hPutChar cd ch}) else return ()) diff --git a/libraries/base/tests/enum01.hs b/libraries/base/tests/enum01.hs index 245f6f7105..5aea7dea4d 100644 --- a/libraries/base/tests/enum01.hs +++ b/libraries/base/tests/enum01.hs @@ -36,7 +36,7 @@ main = do putStrLn "Testing Enum (Ratio Int): " testEnumRatioInt -{- +{- Here's the properties that's supposed to hold for arithmetic sequences over Int: @@ -44,30 +44,30 @@ main = do - [e1,e2..] = [e1, (e1+i), (e1+2*i), ... upper] where - i = e2 - e1 - upper - | i > 0 = maxBound - | i < 0 = minBound - | i == 0 = maxBound -- this really shouldn't matter (I feel.) + i = e2 - e1 + upper + | i > 0 = maxBound + | i < 0 = minBound + | i == 0 = maxBound -- this really shouldn't matter (I feel.) - [e1..e3] = [e1, (e1+i), (e1+2*i),..e3] where - i - | e3 >= e1 = 1 - | e3 < e1 = (-1) - + i + | e3 >= e1 = 1 + | e3 < e1 = (-1) + - [e1,e2..e3] = res where - i = e2 - e1 - - res - | i >= 0 && e3 < e1 = [] - | i < 0 && e3 >= e1 = [] -- (*) - | otherwise = [e1, (e1+i), (e1 + 2*i), .. e3] + i = e2 - e1 + + res + | i >= 0 && e3 < e1 = [] + | i < 0 && e3 >= e1 = [] -- (*) + | otherwise = [e1, (e1+i), (e1 + 2*i), .. e3] Note: (*) - I think this instead should be (i < 0 && e3 > e1), since, as is, - [x,(x+1) ..x] = [x] + [x,(x+1) ..x] = [x] [x,(x-1) ..x] = [] which does not look right, symmetrically speaking. @@ -75,7 +75,7 @@ main = do The same properties hold for other Prelude types that are instances of Enum as well as being Bounded. - + For non-Bounded types (e.g., Float and Double), the properties are similar, except that the boundary tests become slightly different, i.e., when an element becomes greater than (e3 + i/2) (or less than (e3 + i/2) for negative @@ -98,7 +98,7 @@ testEnumInt = do -- pred printTest (pred (1::Int)) printTest (pred (maxBound::Int)) - mayBomb (printTest (pred (minBound::Int))) + mayBomb (printTest (pred (minBound::Int))) -- toEnum printTest ((map (toEnum::Int->Int) [1,minBound,maxBound])) @@ -109,7 +109,7 @@ testEnumInt = do -- [x..] aka enumFrom printTest ((take 7 [(1::Int)..])) printTest ((take 7 [((maxBound::Int)-5)..])) -- just in case it doesn't catch the upper bound.. - + -- [x,y..] aka enumFromThen printTest ((take 7 [(1::Int),2..])) printTest ((take 7 [(1::Int),7..])) @@ -123,7 +123,7 @@ testEnumInt = do let x = (maxBound::Int) - 5 printTest ((take 7 [x, (x+1) ..])) - -- Test overflow conditions + -- Test overflow conditions printTest (([minBound::Int,1..])) printTest (([minBound::Int,0..])) printTest (([minBound::Int,-1..])) @@ -148,7 +148,7 @@ testEnumInt = do printTest ((take 7 [(2::Int),1..1])) printTest ((take 7 [(2::Int),3..1])) - -- Test overflow conditions + -- Test overflow conditions printTest (([minBound, 1..maxBound::Int])) printTest (([minBound, 0..maxBound::Int])) printTest (([minBound,-1..maxBound::Int])) @@ -190,7 +190,7 @@ testEnumChar = do do{ putStr ( " " ++ "(take 7 ['\\NUL' .. ])" ++ " = " ) ; print (take 7 ['\NUL' .. ]) } -- printTest ((take 7 ['\250' .. ])) do{ putStr ( " " ++ "(take 7 ['\\250' .. ])" ++ " = " ) ; print (take 7 ['\250' .. ]) } - + -- [x,y..] aka enumFromThen printTest ((take 7 ['a','b'..])) printTest ((take 7 ['a','e'..])) @@ -237,7 +237,7 @@ testEnumUnit = do mayBomb (printTest ((succ ()))) mayBomb (printTest ((succ (minBound::())))) mayBomb (printTest ((succ (maxBound::())))) - + -- pred: mayBomb (printTest ((pred ()))) mayBomb (printTest ((pred (minBound::())))) @@ -268,7 +268,7 @@ testEnumOrdering = do printTest ((succ LT)) printTest ((succ (minBound::Ordering))) mayBomb (printTest ((succ (maxBound::Ordering)))) - + -- pred: printTest ((pred GT)) printTest ((pred (maxBound::Ordering))) @@ -322,7 +322,7 @@ testEnumBool = do printTest ((succ False)) printTest ((succ (minBound::Bool))) mayBomb (printTest ((succ (maxBound::Bool)))) - + -- pred: printTest ((pred True)) printTest ((pred (maxBound::Bool))) @@ -380,7 +380,7 @@ testEnumInteger = do -- [x..] aka enumFrom printTest ((take 7 [(1::Integer)..])) printTest ((take 7 [(-5::Integer)..])) - + -- [x,y..] aka enumFromThen printTest ((take 7 [(1::Integer),2..])) printTest ((take 7 [(1::Integer),7..])) @@ -422,7 +422,7 @@ testEnumRational = do -- [x..] aka enumFrom printTest ((take 7 [(1::Rational)..])) printTest ((take 7 [(-5::Rational)..])) - + -- [x,y..] aka enumFromThen printTest ((take 7 [(1::Rational),2..])) printTest ((take 7 [(1::Rational),7..])) @@ -465,7 +465,7 @@ testEnumRatioInt = do printTest ((take 7 [(1::Ratio Int)..])) printTest ((take 7 [(-5::Ratio Int)..])) printTest ((take 7 [((toEnum ((maxBound::Int)-5))::Ratio Int)..])) - + -- [x,y..] aka enumFromThen printTest ((take 7 [(1::Ratio Int),2..])) printTest ((take 7 [(1::Ratio Int),7..])) diff --git a/libraries/base/tests/enum04.hs b/libraries/base/tests/enum04.hs index 8120a5bb21..a96d747057 100644 --- a/libraries/base/tests/enum04.hs +++ b/libraries/base/tests/enum04.hs @@ -7,8 +7,8 @@ import Control.Exception -- sample code in the Prelude doesn't agree, at least for -- Float and Double). -main = do - catch (evaluate [error "" :: Int ..] >> return ()) (\(e::SomeException) -> putStrLn "ok1") - catch (evaluate [error "" :: Integer ..] >> return ()) (\(e::SomeException) -> putStrLn "ok2") - catch (evaluate [error "" :: Float ..] >> return ()) (\(e::SomeException) -> putStrLn "ok3") - catch (evaluate [error "" :: Double ..] >> return ()) (\(e::SomeException) -> putStrLn "ok4") +main = do + catch (evaluate [error "" :: Int ..] >> return ()) (\(e::SomeException) -> putStrLn "ok1") + catch (evaluate [error "" :: Integer ..] >> return ()) (\(e::SomeException) -> putStrLn "ok2") + catch (evaluate [error "" :: Float ..] >> return ()) (\(e::SomeException) -> putStrLn "ok3") + catch (evaluate [error "" :: Double ..] >> return ()) (\(e::SomeException) -> putStrLn "ok4") diff --git a/libraries/base/tests/hGetBuf002.hs b/libraries/base/tests/hGetBuf002.hs index 525eeb8e36..4630fba738 100644 --- a/libraries/base/tests/hGetBuf002.hs +++ b/libraries/base/tests/hGetBuf002.hs @@ -9,14 +9,14 @@ test blocking = do let sz = 42 loop = do - b <- allocaBytes sz $ \ptr -> do + b <- allocaBytes sz $ \ptr -> do r <- (if blocking then hGetBuf else hGetBufNonBlocking) h ptr sz - if (r == 0) - then return True - else do s <- peekCStringLen (ptr,r) - putStr s - return False - if b then return () else loop -- tail call + if (r == 0) + then return True + else do s <- peekCStringLen (ptr,r) + putStr s + return False + if b then return () else loop -- tail call loop diff --git a/libraries/base/tests/hGetBuf002.stdout b/libraries/base/tests/hGetBuf002.stdout index 9cbe498c5c..5563115b6b 100644 --- a/libraries/base/tests/hGetBuf002.stdout +++ b/libraries/base/tests/hGetBuf002.stdout @@ -9,14 +9,14 @@ test blocking = do let sz = 42 loop = do - b <- allocaBytes sz $ \ptr -> do + b <- allocaBytes sz $ \ptr -> do r <- (if blocking then hGetBuf else hGetBufNonBlocking) h ptr sz - if (r == 0) - then return True - else do s <- peekCStringLen (ptr,r) - putStr s - return False - if b then return () else loop -- tail call + if (r == 0) + then return True + else do s <- peekCStringLen (ptr,r) + putStr s + return False + if b then return () else loop -- tail call loop @@ -31,14 +31,14 @@ test blocking = do let sz = 42 loop = do - b <- allocaBytes sz $ \ptr -> do + b <- allocaBytes sz $ \ptr -> do r <- (if blocking then hGetBuf else hGetBufNonBlocking) h ptr sz - if (r == 0) - then return True - else do s <- peekCStringLen (ptr,r) - putStr s - return False - if b then return () else loop -- tail call + if (r == 0) + then return True + else do s <- peekCStringLen (ptr,r) + putStr s + return False + if b then return () else loop -- tail call loop diff --git a/libraries/base/tests/hGetBuf003.hs b/libraries/base/tests/hGetBuf003.hs index 6eefdf90e8..ae6f1542bd 100644 --- a/libraries/base/tests/hGetBuf003.hs +++ b/libraries/base/tests/hGetBuf003.hs @@ -13,14 +13,14 @@ test blocking = do -- mix ordinary char buffering with hGetBuf eof <- hIsEOF h when (not eof) $ hGetChar h >>= putChar - b <- allocaBytes sz $ \ptr -> do + b <- allocaBytes sz $ \ptr -> do r <- (if blocking then hGetBuf else hGetBufNonBlocking) h ptr sz - if (r == 0) - then return True - else do s <- peekCStringLen (ptr,r) - putStr s - return False - if b then return () else loop -- tail call + if (r == 0) + then return True + else do s <- peekCStringLen (ptr,r) + putStr s + return False + if b then return () else loop -- tail call loop diff --git a/libraries/base/tests/hGetBuf003.stdout b/libraries/base/tests/hGetBuf003.stdout index ffeb291563..8facaa0acb 100644 --- a/libraries/base/tests/hGetBuf003.stdout +++ b/libraries/base/tests/hGetBuf003.stdout @@ -13,14 +13,14 @@ test blocking = do -- mix ordinary char buffering with hGetBuf eof <- hIsEOF h when (not eof) $ hGetChar h >>= putChar - b <- allocaBytes sz $ \ptr -> do + b <- allocaBytes sz $ \ptr -> do r <- (if blocking then hGetBuf else hGetBufNonBlocking) h ptr sz - if (r == 0) - then return True - else do s <- peekCStringLen (ptr,r) - putStr s - return False - if b then return () else loop -- tail call + if (r == 0) + then return True + else do s <- peekCStringLen (ptr,r) + putStr s + return False + if b then return () else loop -- tail call loop @@ -39,14 +39,14 @@ test blocking = do -- mix ordinary char buffering with hGetBuf eof <- hIsEOF h when (not eof) $ hGetChar h >>= putChar - b <- allocaBytes sz $ \ptr -> do + b <- allocaBytes sz $ \ptr -> do r <- (if blocking then hGetBuf else hGetBufNonBlocking) h ptr sz - if (r == 0) - then return True - else do s <- peekCStringLen (ptr,r) - putStr s - return False - if b then return () else loop -- tail call + if (r == 0) + then return True + else do s <- peekCStringLen (ptr,r) + putStr s + return False + if b then return () else loop -- tail call loop diff --git a/libraries/base/tests/list001.hs b/libraries/base/tests/list001.hs index a2a39dd86d..4c622afc62 100644 --- a/libraries/base/tests/list001.hs +++ b/libraries/base/tests/list001.hs @@ -139,14 +139,14 @@ main = do print (unwords (words "a b c d"), words "", unwords []) -- deleteBy - print [deleteBy (==) 1 [0,1,1,2,3,4], - deleteBy (==) (error "deleteBy") []] + print [deleteBy (==) 1 [0,1,1,2,3,4], + deleteBy (==) (error "deleteBy") []] -- delete - print [delete 1 [0,1,1,2,3,4], - delete (error "delete") []] - + print [delete 1 [0,1,1,2,3,4], + delete (error "delete") []] + -- (\\) print [ [0,1,1,2,3,4] \\ [3,2,1], [1,2,3,4] \\ [], - [] \\ [error "\\\\"] ] + [] \\ [error "\\\\"] ] diff --git a/libraries/base/tests/list002.hs b/libraries/base/tests/list002.hs index 188ff8953d..5e069e09f6 100644 --- a/libraries/base/tests/list002.hs +++ b/libraries/base/tests/list002.hs @@ -3,4 +3,4 @@ import Data.List main = print (sortBy (\(a,b) (a',b')->compare a a') - ([1,1,1,1,1,1,1,1,1,1]`zip`[1..10])) + ([1,1,1,1,1,1,1,1,1,1]`zip`[1..10])) diff --git a/libraries/base/tests/memo002.hs b/libraries/base/tests/memo002.hs index aa0a1d27c9..9830523c34 100644 --- a/libraries/base/tests/memo002.hs +++ b/libraries/base/tests/memo002.hs @@ -6,11 +6,11 @@ import System.Environment ( getArgs ) main :: IO () main = do (arg:_) <- getArgs - mapM_ printTriple [ (i,fib i,mfib i) | i <- [10..read arg] ] + mapM_ printTriple [ (i,fib i,mfib i) | i <- [10..read arg] ] where printTriple (i,fi,mfi) = do print i - print fi - print mfi - putStrLn "" + print fi + print mfi + putStrLn "" -- There is not much point in memoising Integers, so we use unary "numbers" instead mfib :: Integer -> Integer diff --git a/libraries/base/tests/reads001.hs b/libraries/base/tests/reads001.hs index 318367e7f4..44c5a156f0 100644 --- a/libraries/base/tests/reads001.hs +++ b/libraries/base/tests/reads001.hs @@ -3,8 +3,8 @@ module Main(main) where main = do { print soh ; print (length (fst (head soh))) ; - print so ; print (length (fst (head so))) } + print so ; print (length (fst (head so))) } where - so, soh :: [(String,String)] - soh = reads "\"\\SOH\"" -- Should read \SOH - so = reads "\"\\SOx\"" -- Should read \SO followed by x + so, soh :: [(String,String)] + soh = reads "\"\\SOH\"" -- Should read \SOH + so = reads "\"\\SOx\"" -- Should read \SO followed by x diff --git a/libraries/base/tests/stableptr001.hs b/libraries/base/tests/stableptr001.hs index 1bc857aba6..f66a616e11 100644 --- a/libraries/base/tests/stableptr001.hs +++ b/libraries/base/tests/stableptr001.hs @@ -5,15 +5,15 @@ import Foreign -- simple test for building/dereferencing stable ptrs -main - = do l <- mapM newStablePtr [1..100000] - sum <- stable_sum l - print sum +main + = do l <- mapM newStablePtr [1..100000] + sum <- stable_sum l + print sum stable_sum :: [StablePtr Integer] -> IO Integer stable_sum [] = return 0 -stable_sum (x:xs) - = do x' <- deRefStablePtr x - freeStablePtr x - xs' <- stable_sum xs +stable_sum (x:xs) + = do x' <- deRefStablePtr x + freeStablePtr x + xs' <- stable_sum xs return (x' + xs') diff --git a/libraries/base/tests/text001.hs b/libraries/base/tests/text001.hs index 18aab82dd9..bb73297b88 100644 --- a/libraries/base/tests/text001.hs +++ b/libraries/base/tests/text001.hs @@ -1,4 +1,4 @@ -{- Bug report 28 May 99 +{- Bug report 28 May 99 When compiled with ghc-4.02, everything's fine, it outputs "Value 7" as expected. But compiled with ghc-pre-4.03 it yields this error message. @@ -9,7 +9,7 @@ expected. But compiled with ghc-pre-4.03 it yields this error message. module Main where data Msg = Value Int | Inc deriving (Show, Read) - + main = do let v = read "Value 7"::Msg print v diff --git a/libraries/base/tests/trace001.hs b/libraries/base/tests/trace001.hs index 2ed61d486e..1d3341c814 100644 --- a/libraries/base/tests/trace001.hs +++ b/libraries/base/tests/trace001.hs @@ -3,8 +3,8 @@ import Debug.Trace main = do hPutStr stderr - (trace (trace (trace (trace (trace (trace (trace - "one" "fish") "two") "fish") "red") "fish") "blue") "fish") + (trace (trace (trace (trace (trace (trace (trace + "one" "fish") "two") "fish") "red") "fish") "blue") "fish") hPutStr stdout - (trace (trace (trace (trace (trace (trace (trace - "ONE" "FISH") "TWO") "FISH") "RED") "FISH") "BLUE") "FISH") + (trace (trace (trace (trace (trace (trace (trace + "ONE" "FISH") "TWO") "FISH") "RED") "FISH") "BLUE") "FISH") diff --git a/libraries/base/tests/tup001.hs b/libraries/base/tests/tup001.hs index a70e09027a..e63fcb8ff0 100644 --- a/libraries/base/tests/tup001.hs +++ b/libraries/base/tests/tup001.hs @@ -25,9 +25,9 @@ t0 = () big = (t0,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15) main = do print big - print (read (show big) `asTypeOf` big) - print (big == big) - print (big < big) - print (big > big) - print (minBound `asTypeOf` big) - print (maxBound `asTypeOf` big)
\ No newline at end of file + print (read (show big) `asTypeOf` big) + print (big == big) + print (big < big) + print (big > big) + print (minBound `asTypeOf` big) + print (maxBound `asTypeOf` big) |