diff options
author | Paolo Capriotti <p.capriotti@gmail.com> | 2012-03-09 13:11:08 +0000 |
---|---|---|
committer | Paolo Capriotti <p.capriotti@gmail.com> | 2012-03-09 13:11:08 +0000 |
commit | 25017dbb9e09feb410cfba1326214a4903336b29 (patch) | |
tree | 0e50eebe274eed3be7a00abd1e51a4d879c0a0d2 /testsuite/tests/lib | |
parent | 253d34d2f8542b323bb72c9f8c154d6716319599 (diff) | |
download | haskell-25017dbb9e09feb410cfba1326214a4903336b29.tar.gz |
Move base and unix tests to respective packages; part of #1161.
Diffstat (limited to 'testsuite/tests/lib')
299 files changed, 0 insertions, 9683 deletions
diff --git a/testsuite/tests/lib/Concurrent/4876.hs b/testsuite/tests/lib/Concurrent/4876.hs deleted file mode 100644 index 68c2a871b8..0000000000 --- a/testsuite/tests/lib/Concurrent/4876.hs +++ /dev/null @@ -1,19 +0,0 @@ -import System.Random -import Control.Concurrent.SampleVar -import Control.Concurrent -import Control.Monad - -produce, consume :: SampleVar Int -> IO () -produce svar = do - b <- isEmptySampleVar svar - if b then writeSampleVar svar 3 else return () - -consume svar = readSampleVar svar >>= print - -main = do - svar <- newEmptySampleVar - m <- newEmptyMVar - forkIO $ consume svar >> putMVar m () - threadDelay 100000 -- 100 ms - produce svar - takeMVar m -- deadlocked before the fix in #4876 diff --git a/testsuite/tests/lib/Concurrent/4876.stdout b/testsuite/tests/lib/Concurrent/4876.stdout deleted file mode 100644 index 00750edc07..0000000000 --- a/testsuite/tests/lib/Concurrent/4876.stdout +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/testsuite/tests/lib/Concurrent/Chan001.hs b/testsuite/tests/lib/Concurrent/Chan001.hs deleted file mode 100644 index e4b668ac48..0000000000 --- a/testsuite/tests/lib/Concurrent/Chan001.hs +++ /dev/null @@ -1,109 +0,0 @@ -import Debug.QuickCheck
-import System.IO.Unsafe
-import Control.Concurrent.Chan
-import Control.Concurrent
-import Control.Monad
-
-data Action = NewChan | ReadChan | WriteChan Int | IsEmptyChan | ReturnInt Int
- | ReturnBool Bool
- deriving (Eq,Show)
-
-
-main = do
- t <- myThreadId
- forkIO (threadDelay 1000000 >> killThread t)
- -- just in case we deadlock
- testChan
-
-testChan :: IO ()
-testChan = do
- quickCheck prop_NewIs_NewRet
- quickCheck prop_NewWriteIs_NewRet
- quickCheck prop_NewWriteRead_NewRet
-
-
-prop_NewIs_NewRet =
- [NewChan,IsEmptyChan] =^ [NewChan,ReturnBool True]
-
-prop_NewWriteIs_NewRet n =
- [NewChan,WriteChan n,IsEmptyChan] =^ [NewChan,WriteChan n,ReturnBool False]
-
-prop_NewWriteRead_NewRet n =
- [NewChan,WriteChan n,ReadChan] =^ [NewChan,ReturnInt n]
-
-
-perform :: [Action] -> IO ([Bool],[Int])
-perform [] = return ([],[])
-
-perform (a:as) =
- case a of
- ReturnInt v -> liftM (\(b,l) -> (b,v:l)) (perform as)
- ReturnBool v -> liftM (\(b,l) -> (v:b,l)) (perform as)
- NewChan -> newChan >>= \chan -> perform' chan as
- _ -> error $ "Please use NewChan as first action"
-
-
-perform' :: Chan Int -> [Action] -> IO ([Bool],[Int])
-perform' _ [] = return ([],[])
-
-perform' chan (a:as) =
- case a of
- ReturnInt v -> liftM (\(b,l) -> (b,v:l)) (perform' chan as)
- ReturnBool v -> liftM (\(b,l) -> (v:b,l)) (perform' chan as)
- ReadChan -> liftM2 (\v (b,l) -> (b,v:l)) (readChan chan)
- (perform' chan as)
- WriteChan n -> writeChan chan n >> perform' chan as
- IsEmptyChan -> liftM2 (\v (b,l) -> (v:b,l)) (isEmptyChan chan)
- (perform' chan as)
- _ -> error $ "If you want to use " ++ show a
- ++ " please use the =^ operator"
-
-
-actions :: Gen [Action]
-actions =
- liftM (NewChan:) (actions' 0)
-
-
-actions' :: Int -> Gen [Action]
-actions' contents =
- oneof ([return [],
- liftM (IsEmptyChan:) (actions' contents),
- liftM2 (:) (liftM WriteChan arbitrary) (actions' (contents+1))]
- ++
- if contents==0
- then []
- else [liftM (ReadChan:) (actions' (contents-1))])
-
-
-(=^) :: [Action] -> [Action] -> Property
-c =^ c' =
- forAll (actions' (delta 0 c))
- (\suff -> observe c suff == observe c' suff)
- where observe x suff = unsafePerformIO (perform (x++suff))
-
-
-(^=^) :: [Action] -> [Action] -> Property
-c ^=^ c' =
- forAll actions
- (\pref -> forAll (actions' (delta 0 (pref++c)))
- (\suff -> observe c pref suff ==
- observe c' pref suff))
- where observe x pref suff = unsafePerformIO (perform (pref++x++suff))
-
-
-delta :: Int -> [Action] -> Int
-delta i [] = i
-
-delta i (ReturnInt _:as) = delta i as
-
-delta i (ReturnBool _:as) = delta i as
-
-delta _ (NewChan:as) = delta 0 as
-
-delta i (WriteChan _:as) = delta (i+1) as
-
-delta i (ReadChan:as) = delta (if i==0
- then error "read on empty Chan"
- else i-1) as
-
-delta i (IsEmptyChan:as) = delta i as
diff --git a/testsuite/tests/lib/Concurrent/Chan001.stdout b/testsuite/tests/lib/Concurrent/Chan001.stdout deleted file mode 100644 index 53bfa8a381..0000000000 --- a/testsuite/tests/lib/Concurrent/Chan001.stdout +++ /dev/null @@ -1,3 +0,0 @@ -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. diff --git a/testsuite/tests/lib/Concurrent/MVar001.hs b/testsuite/tests/lib/Concurrent/MVar001.hs deleted file mode 100644 index f787470c51..0000000000 --- a/testsuite/tests/lib/Concurrent/MVar001.hs +++ /dev/null @@ -1,148 +0,0 @@ -import Debug.QuickCheck
-import System.IO.Unsafe
-import Control.Concurrent.MVar
-import Control.Concurrent
-import Control.Monad
-
-
-data Action = NewEmptyMVar | NewMVar Int | TakeMVar | ReadMVar | PutMVar Int
- | SwapMVar Int | IsEmptyMVar | ReturnInt Int | ReturnBool Bool
- deriving (Eq,Show)
-
-main = do
- t <- myThreadId
- forkIO (threadDelay 1000000 >> killThread t)
- -- just in case we deadlock
- testMVar
-
-testMVar :: IO ()
-testMVar = do
- quickCheck prop_NewEIs_NewERet
- quickCheck prop_NewIs_NewRet
- quickCheck prop_NewTake_NewRet
- quickCheck prop_NewEPutTake_NewERet
- quickCheck prop_NewRead_NewRet
- quickCheck prop_NewSwap_New
-
-
-prop_NewEIs_NewERet =
- [NewEmptyMVar,IsEmptyMVar] =^ [NewEmptyMVar,ReturnBool True]
-
-prop_NewIs_NewRet n =
- [NewMVar n,IsEmptyMVar] =^ [NewMVar n,ReturnBool False]
-
-prop_NewTake_NewRet n =
- [NewMVar n,TakeMVar] =^ [NewEmptyMVar,ReturnInt n]
-
-prop_NewEPutTake_NewERet n =
- [NewEmptyMVar,PutMVar n,TakeMVar] =^
- [NewEmptyMVar,ReturnInt n]
-
-prop_NewRead_NewRet n =
- [NewMVar n,ReadMVar] =^ [NewMVar n,ReturnInt n]
-
-prop_NewSwap_New m n =
- [NewMVar m,SwapMVar n] =^ [NewMVar n]
-
-
-perform :: [Action] -> IO ([Bool],[Int])
-perform [] = return ([],[])
-
-perform (a:as) =
- case a of
- ReturnInt v -> liftM (\(b,l) -> (b,v:l)) (perform as)
- ReturnBool v -> liftM (\(b,l) -> (v:b,l)) (perform as)
- NewEmptyMVar -> newEmptyMVar >>= \mv -> perform' mv as
- NewMVar n -> newMVar n >>= \mv -> perform' mv as
- _ -> error $ "Please use NewMVar or NewEmptyMVar as first "
- ++ "action"
-
-
-perform' :: MVar Int -> [Action] -> IO ([Bool],[Int])
-perform' _ [] = return ([],[])
-
-perform' mv (a:as) =
- case a of
- ReturnInt v -> liftM (\(b,l) -> (b,v:l)) (perform' mv as)
- ReturnBool v -> liftM (\(b,l) -> (v:b,l)) (perform' mv as)
- TakeMVar -> liftM2 (\v (b,l) -> (b,v:l)) (takeMVar mv)
- (perform' mv as)
- ReadMVar -> liftM2 (\v (b,l) -> (b,v:l)) (readMVar mv)
- (perform' mv as)
- PutMVar n -> putMVar mv n >> perform' mv as
- SwapMVar n -> swapMVar mv n >> perform' mv as
- IsEmptyMVar -> liftM2 (\v (b,l) -> (v:b,l)) (isEmptyMVar mv)
- (perform' mv as)
- _ -> error $ "If you want to use " ++ show a
- ++ " please use the =^ operator"
-
-
-actions :: Gen [Action]
-actions = do
- oneof [liftM (NewEmptyMVar:) (actions' True),
- liftM2 (:) (liftM NewMVar arbitrary) (actions' False)]
-
-
-actions' :: Bool -> Gen [Action]
-actions' empty =
- oneof ([return [],
- liftM (IsEmptyMVar:) (actions' empty)] ++
- if empty
- then [liftM2 (:) (liftM PutMVar arbitrary) (actions' False)]
- else []
- ++
- if empty
- then []
- else [liftM (TakeMVar:) (actions' True)]
- ++
- if empty
- then []
- else [liftM (ReadMVar:) (actions' False)]
- ++
- if empty
- then []
- else [liftM2 (:) (liftM SwapMVar arbitrary) (actions' False)] )
-
-
-(=^) :: [Action] -> [Action] -> Property
-c =^ c' =
- forAll (actions' (delta True c))
- (\suff -> observe c suff == observe c' suff)
- where observe x suff = unsafePerformIO (perform (x++suff))
-
-
-(^=^) :: [Action] -> [Action] -> Property
-c ^=^ c' =
- forAll actions
- (\pref -> forAll (actions' (delta True (pref++c)))
- (\suff -> observe c pref suff ==
- observe c' pref suff))
- where observe x pref suff = unsafePerformIO (perform (pref++x++suff))
-
-
-delta :: Bool -> [Action] -> Bool
-delta b [] = b
-
-delta b (ReturnInt _:as) = delta b as
-
-delta b (ReturnBool _:as) = delta b as
-
-delta _ (NewEmptyMVar:as) = delta True as
-
-delta _ (NewMVar _:as) = delta False as
-
-delta b (TakeMVar:as) = delta (if b
- then error "take on empty MVar"
- else True) as
-
-delta b (ReadMVar:as) = delta (if b
- then error "read on empty MVar"
- else False) as
-
-delta _ (PutMVar _:as) = delta False as
-
-delta b (SwapMVar _:as) = delta (if b
- then error "swap on empty MVar"
- else False) as
-
-delta b (IsEmptyMVar:as) = delta b as
diff --git a/testsuite/tests/lib/Concurrent/MVar001.stdout b/testsuite/tests/lib/Concurrent/MVar001.stdout deleted file mode 100644 index 65be56c733..0000000000 --- a/testsuite/tests/lib/Concurrent/MVar001.stdout +++ /dev/null @@ -1,6 +0,0 @@ -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. diff --git a/testsuite/tests/lib/Concurrent/Makefile b/testsuite/tests/lib/Concurrent/Makefile deleted file mode 100644 index 9101fbd40a..0000000000 --- a/testsuite/tests/lib/Concurrent/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk diff --git a/testsuite/tests/lib/Concurrent/QSem001.hs b/testsuite/tests/lib/Concurrent/QSem001.hs deleted file mode 100644 index 1f255997e7..0000000000 --- a/testsuite/tests/lib/Concurrent/QSem001.hs +++ /dev/null @@ -1,93 +0,0 @@ -import Debug.QuickCheck
-import System.IO.Unsafe
-import Control.Concurrent.QSem
-import Control.Concurrent
-import Control.Monad
-
-
-main = do
- t <- myThreadId
- forkIO (threadDelay 1000000 >> killThread t)
- -- just in case we deadlock
- testQSem
-
-data Action = NewQSem Int | SignalQSem | WaitQSem
- deriving (Eq,Show)
-
-
-testQSem :: IO ()
-testQSem = do
- quietCheck prop_SignalWait
- quietCheck prop_WaitSignal
-
-quietCheck = check defaultConfig{configEvery = \n args -> ""}
-
-prop_SignalWait n =
- n>=0 ==> [NewQSem n,SignalQSem,WaitQSem] =^ [NewQSem n]
-
-prop_WaitSignal n =
- n>=1 ==> [NewQSem n,WaitQSem,SignalQSem] =^ [NewQSem n]
-
-
-perform :: [Action] -> IO ()
-perform [] = return ()
-
-perform (a:as) =
- case a of
- NewQSem n -> newQSem n >>= \qs -> perform' qs as
- _ -> error $ "Please use NewQSem as first action" ++ show a
-
-
-perform' :: QSem -> [Action] -> IO ()
-perform' _ [] = return ()
-
-perform' qs (a:as) =
- case a of
- SignalQSem -> signalQSem qs >> perform' qs as
- WaitQSem -> waitQSem qs >> perform' qs as
- _ -> error $ "If you want to use " ++ show a
- ++ " please use the =^ operator"
-
-
-actions :: Gen [Action]
-actions = do
- i <- arbitrary
- liftM (NewQSem i:) (actions' i)
-
-
-actions' :: Int -> Gen [Action]
-actions' quantity =
- oneof ([return [],
- liftM (SignalQSem:) (actions' (quantity+1))] ++
- if quantity<=0
- then []
- else [liftM (WaitQSem:) (actions' (quantity-1))])
-
-
-(=^) :: [Action] -> [Action] -> Property
-c =^ c' =
- forAll (actions' (delta 0 c))
- (\suff -> observe c suff == observe c' suff)
- where observe x suff = unsafePerformIO (perform (x++suff))
-
-
-(^=^) :: [Action] -> [Action] -> Property
-c ^=^ c' =
- forAll actions
- (\pref -> forAll (actions' (delta 0 (pref++c)))
- (\suff -> observe c pref suff ==
- observe c' pref suff))
- where observe x pref suff = unsafePerformIO (perform (pref++x++suff))
-
-
-delta :: Int -> [Action] -> Int
-delta i [] = i
-
-delta _ (NewQSem i:as) = delta i as
-
-delta i (SignalQSem:as) = delta (i+1) as
-
-delta i (WaitQSem:as) = delta (if i<=0
- then error "wait on 'empty' QSem"
- else i-1) as
-
diff --git a/testsuite/tests/lib/Concurrent/QSem001.stdout b/testsuite/tests/lib/Concurrent/QSem001.stdout deleted file mode 100644 index 7288d19270..0000000000 --- a/testsuite/tests/lib/Concurrent/QSem001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -OK, passed 100 tests. -OK, passed 100 tests. diff --git a/testsuite/tests/lib/Concurrent/QSemN001.hs b/testsuite/tests/lib/Concurrent/QSemN001.hs deleted file mode 100644 index c31d6a6964..0000000000 --- a/testsuite/tests/lib/Concurrent/QSemN001.hs +++ /dev/null @@ -1,96 +0,0 @@ -import Debug.QuickCheck
-import System.IO.Unsafe
-import Control.Concurrent.QSemN
-import Control.Concurrent
-import Control.Monad
-
-
-main = do
- t <- myThreadId
- forkIO (threadDelay 1000000 >> killThread t)
- -- just in case we deadlock
- testQSemN
-
-data Action = NewQSemN Int | SignalQSemN Int | WaitQSemN Int
- deriving (Eq,Show)
-
-
-testQSemN :: IO ()
-testQSemN = do
- quietCheck prop_SignalWait
- quietCheck prop_WaitSignal
-
-quietCheck = check defaultConfig{configEvery = \n args -> ""}
-
-
-prop_SignalWait l m n = l+m>=n ==>
- [NewQSemN l,SignalQSemN m,WaitQSemN n] =^ [NewQSemN (l+m-n)]
-
-prop_WaitSignal l m n = l>=m ==>
- [NewQSemN l,WaitQSemN m,SignalQSemN n] =^ [NewQSemN (l-m+n)]
-
-
-perform :: [Action] -> IO [Int]
-perform [] = return []
-
-perform (a:as) =
- case a of
- NewQSemN n -> newQSemN n >>= \qs -> perform' qs as
- _ -> error $ "Please use NewQSemN as first action" ++ show a
-
-
-perform' :: QSemN -> [Action] -> IO [Int]
-perform' _ [] = return []
-
-perform' qs (a:as) =
- case a of
- SignalQSemN n -> signalQSemN qs n >> perform' qs as
- WaitQSemN n -> waitQSemN qs n >> perform' qs as
- _ -> error $ "If you want to use " ++ show a
- ++ " please use the =^ operator"
-
-
-actions :: Gen [Action]
-actions = do
- i <- arbitrary
- liftM (NewQSemN i:) (actions' i)
-
-
-actions' :: Int -> Gen [Action]
-actions' quantity =
- oneof ([return [],
- do i<- choose (0,maxBound)
- liftM (SignalQSemN i:) (actions' (quantity+i))] ++
- if quantity<=0
- then []
- else [do i<- choose (0,quantity)
- liftM (WaitQSemN i:) (actions' (quantity-i))])
-
-
-(=^) :: [Action] -> [Action] -> Property
-c =^ c' =
- forAll (actions' (delta 0 c))
- (\suff -> observe c suff == observe c' suff)
- where observe x suff = unsafePerformIO (perform (x++suff))
-
-
-(^=^) :: [Action] -> [Action] -> Property
-c ^=^ c' =
- forAll actions
- (\pref -> forAll (actions' (delta 0 (pref++c)))
- (\suff -> observe c pref suff ==
- observe c' pref suff))
- where observe x pref suff = unsafePerformIO (perform (pref++x++suff))
-
-
-delta :: Int -> [Action] -> Int
-delta i [] = i
-
-delta _ (NewQSemN i:as) = delta i as
-
-delta i (SignalQSemN n:as) = delta (i+n) as
-
-delta i (WaitQSemN n:as) = delta (if i<n
- then error "wait on 'empty' QSemN"
- else i-n) as
-
diff --git a/testsuite/tests/lib/Concurrent/QSemN001.stdout b/testsuite/tests/lib/Concurrent/QSemN001.stdout deleted file mode 100644 index 7288d19270..0000000000 --- a/testsuite/tests/lib/Concurrent/QSemN001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -OK, passed 100 tests. -OK, passed 100 tests. diff --git a/testsuite/tests/lib/Concurrent/SampleVar001.hs b/testsuite/tests/lib/Concurrent/SampleVar001.hs deleted file mode 100644 index def86c5d54..0000000000 --- a/testsuite/tests/lib/Concurrent/SampleVar001.hs +++ /dev/null @@ -1,132 +0,0 @@ --------------------------------------------------------------------------------
--- Module : SampleVarTest
--------------------------------------------------------------------------------
-
-import Debug.QuickCheck
-import System.IO.Unsafe
-import Control.Concurrent
-import Control.Concurrent.SampleVar
-import Control.Monad
-
-
-data Action = NewEmptySampleVar | NewSampleVar Int | EmptySampleVar
- | ReadSampleVar | WriteSampleVar Int | IsEmptySampleVar
- | ReturnInt Int | ReturnBool Bool
- deriving (Eq,Show)
-
-
-main = do
- t <- myThreadId
- forkIO (threadDelay 1000000 >> killThread t)
- -- just in case we deadlock
- testSampleVar
-
-testSampleVar :: IO ()
-testSampleVar = do
- quickCheck prop_NewEIs_NewERet
- quickCheck prop_NewIs_NewRet
- quickCheck prop_NewRead_NewRet
- quickCheck prop_NewEWriteRead_NewERet
- quickCheck prop_WriteEmpty_Empty
- quickCheck prop_WriteRead_Ret
-
-
-
-perform :: [Action] -> IO ([Bool],[Int])
-perform [] = return ([],[])
-
-perform (a:as) =
- case a of
- ReturnInt v -> liftM (\(b,l) -> (b,v:l)) (perform as)
- ReturnBool v -> liftM (\(b,l) -> (v:b,l)) (perform as)
- NewEmptySampleVar -> newEmptySampleVar >>= \sv -> perform' sv as
- NewSampleVar n -> newSampleVar n >>= \sv -> perform' sv as
-
-
-perform' :: SampleVar Int -> [Action] -> IO ([Bool],[Int])
-perform' _ [] = return ([],[])
-
-perform' sv (a:as) =
- case a of
- ReturnInt v -> liftM (\(b,l) -> (b,v:l)) (perform' sv as)
- ReturnBool v -> liftM (\(b,l) -> (v:b,l)) (perform' sv as)
- EmptySampleVar -> emptySampleVar sv >> perform' sv as
- ReadSampleVar -> liftM2 (\v (b,l) -> (b,v:l)) (readSampleVar sv)
- (perform' sv as)
- WriteSampleVar n -> writeSampleVar sv n >> perform' sv as
- IsEmptySampleVar -> liftM2 (\v (b,l) -> (v:b,l)) (isEmptySampleVar sv)
- (perform' sv as)
-
-
-actions :: Gen [Action]
-actions = do
- oneof [liftM (NewEmptySampleVar:) (actions' True),
- liftM2 (:) (liftM NewSampleVar arbitrary) (actions' False)]
-
-
-actions' :: Bool -> Gen [Action]
-actions' empty =
- oneof ([return [],
- liftM (IsEmptySampleVar:) (actions' empty),
- liftM (EmptySampleVar:) (actions' True),
- liftM2 (:) (liftM WriteSampleVar arbitrary) (actions' False)] ++
- if empty
- then []
- else [liftM (ReadSampleVar:) (actions' True)])
-
-
-(=^) :: [Action] -> [Action] -> Property
-c =^ c' =
- forAll (actions' (delta True c))
- (\suff -> observe c suff == observe c' suff)
- where observe x suff = unsafePerformIO (perform (x++suff))
-
-
-(^=^) :: [Action] -> [Action] -> Property
-c ^=^ c' =
- forAll actions
- (\pref -> forAll (actions' (delta True (pref++c)))
- (\suff -> observe c pref suff ==
- observe c' pref suff))
- where observe x pref suff = unsafePerformIO (perform (pref++x++suff))
-
-
-delta :: Bool -> [Action] -> Bool
-delta b [] = b
-
-delta b (ReturnInt _:as) = delta b as
-
-delta b (ReturnBool _:as) = delta b as
-
-delta _ (NewEmptySampleVar:as) = delta True as
-
-delta _ (NewSampleVar _:as) = delta False as
-
-delta _ (EmptySampleVar:as) = delta True as
-
-delta b (ReadSampleVar:as) = delta (if b
- then error "read on empty SampleVar"
- else True) as
-delta _ (WriteSampleVar _:as) = delta False as
-
-delta b (IsEmptySampleVar:as) = delta b as
-
-
-prop_NewEIs_NewERet =
- [NewEmptySampleVar,IsEmptySampleVar] =^ [NewEmptySampleVar,ReturnBool True]
-
-prop_NewIs_NewRet n =
- [NewSampleVar n,IsEmptySampleVar] =^ [NewSampleVar n,ReturnBool False]
-
-prop_NewRead_NewRet n =
- [NewSampleVar n,ReadSampleVar] =^ [NewEmptySampleVar,ReturnInt n]
-
-prop_NewEWriteRead_NewERet n =
- [NewEmptySampleVar,WriteSampleVar n,ReadSampleVar] =^
- [NewEmptySampleVar,ReturnInt n]
-
-prop_WriteEmpty_Empty n =
- [WriteSampleVar n,EmptySampleVar] ^=^ [EmptySampleVar]
-
-prop_WriteRead_Ret n =
- [WriteSampleVar n,ReadSampleVar] ^=^ [EmptySampleVar,ReturnInt n]
diff --git a/testsuite/tests/lib/Concurrent/SampleVar001.stdout b/testsuite/tests/lib/Concurrent/SampleVar001.stdout deleted file mode 100644 index 65be56c733..0000000000 --- a/testsuite/tests/lib/Concurrent/SampleVar001.stdout +++ /dev/null @@ -1,6 +0,0 @@ -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. -0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899OK, passed 100 tests. diff --git a/testsuite/tests/lib/Concurrent/ThreadDelay001.hs b/testsuite/tests/lib/Concurrent/ThreadDelay001.hs deleted file mode 100644 index c60f997039..0000000000 --- a/testsuite/tests/lib/Concurrent/ThreadDelay001.hs +++ /dev/null @@ -1,26 +0,0 @@ - --- Test that threadDelay actually sleeps for (at least) as long as we --- ask it - -module Main (main) where - -import Control.Concurrent -import Control.Monad -import System.Time - -main = mapM_ delay (0 : take 11 (iterate (*5) 1)) - -delay n = do - tS <- getClockTime - threadDelay n - tE <- getClockTime - - let req = fromIntegral n * 10 ^ (6 :: Int) - obs = case normalizeTimeDiff (diffClockTimes tE tS) of - TimeDiff 0 0 0 0 0 s ps -> 10^12 * fromIntegral s + ps - diff = obs - req - diff' :: Double - diff' = fromIntegral diff / 10^(12 :: Int) - - when (obs < req) $ print (tS, tE, req, obs, diff, diff') - diff --git a/testsuite/tests/lib/Concurrent/all.T b/testsuite/tests/lib/Concurrent/all.T deleted file mode 100644 index 004c6a1226..0000000000 --- a/testsuite/tests/lib/Concurrent/all.T +++ /dev/null @@ -1,10 +0,0 @@ -setTestOpts(only_compiler_types(['ghc'])) - -test('SampleVar001', reqlib('QuickCheck'), compile_and_run, ['-package QuickCheck']) -test('4876', reqlib('random'), compile_and_run, ['']) # another SampleVar test - -test('Chan001', reqlib('QuickCheck'), compile_and_run, ['-package QuickCheck']) -test('MVar001', reqlib('QuickCheck'), compile_and_run, ['-package QuickCheck']) -test('QSemN001', reqlib('QuickCheck'), compile_and_run, ['-package QuickCheck']) -test('QSem001', reqlib('QuickCheck'), compile_and_run, ['-package QuickCheck']) -test('ThreadDelay001', normal, compile_and_run, ['']) diff --git a/testsuite/tests/lib/IO/2122.hs b/testsuite/tests/lib/IO/2122.hs deleted file mode 100644 index 6807f3476a..0000000000 --- a/testsuite/tests/lib/IO/2122.hs +++ /dev/null @@ -1,76 +0,0 @@ -{- - -Before running this, check that /tmp/test does not exist and -contain something important. Then do: - - $ touch /tmp/test - -If you do: - - $ runhaskell Test.hs - -it will work. If you do: - - $ runhaskell Test.hs fail - -it will fail every time with: - -Test.hs: writeFile: /tmp/test: openFile: resource busy (file is locked) - --} - -import Control.Monad -import System.Directory -import System.IO -import System.Environment --- Used by test2: --- import System.Posix.IO - -fp = "2122-test" - -main :: IO () -main = do - writeFile fp "test" - test True - --- fails everytime when causeFailure is True in GHCi, with runhaskell, --- or when compiled. -test :: Bool -> IO () -test causeFailure = - do h1 <- openFile fp ReadMode `Prelude.catch` (\e -> error ("openFile 1: " ++ show e)) - when causeFailure $ do - h2 <- openFile fp ReadMode `Prelude.catch` (\e -> error ("openFile 2: " ++ show e)) - hClose h2 - hClose h1 - removeFile fp - writeFile fp (show [1..100]) `Prelude.catch` (\e -> error ("writeFile: " ++ show e)) - -{- --- this version never fails (except in GHCi, if test has previously failed). --- probably because openFd does not try to lock the file -test2 :: Bool -> IO () -test2 causeFailure = - do fd1 <- openFd fp ReadOnly Nothing defaultFileFlags `Prelude.catch` (\e -> error ("openFile 1: " ++ show e)) - when causeFailure $ do - fd2 <- openFd fp ReadOnly Nothing defaultFileFlags `Prelude.catch` (\e -> error ("openFile 2: " ++ show e)) - closeFd fd2 - closeFd fd1 - removeFile fp - writeFile fp (show [1..100]) `Prelude.catch` (\e -> error ("writeFile: " ++ show e)) --} - -{- --- fails sometimes when run repeated in GHCi, but seems fine with --- runhaskell or compiled -test3 :: IO () -test3 = - do h1 <- openFile fp ReadMode `Prelude.catch` (\e -> error ("openFile 1: " ++ show e)) - h2 <- openFile fp ReadMode `Prelude.catch` (\e -> error ("openFile 2: " ++ show e)) - removeFile fp - writeFile fp (show [1..100]) `Prelude.catch` (\e -> error ("writeFile: " ++ show e)) - print =<< hGetContents h1 - print =<< hGetContents h2 - hClose h2 - hClose h1 --} - diff --git a/testsuite/tests/lib/IO/3307.hs b/testsuite/tests/lib/IO/3307.hs deleted file mode 100644 index fb1a360ea2..0000000000 --- a/testsuite/tests/lib/IO/3307.hs +++ /dev/null @@ -1,52 +0,0 @@ -import Control.Exception - -import System.Directory -import System.Environment -import System.IO - -import Data.Char -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 - print $ map ord file - readFile file >>= putStr - - -- 2) A file name arriving via getDirectoryContents - putStrLn "Test 2" - [file] <- fmap (filter ("chinese-file-" `isPrefixOf`)) $ getDirectoryContents "." - print $ map ord file - readFile file >>= putStr - - -- 3) A file name occurring literally in the program - -- The file is created with a UTF-8 file name as well, so this will only work in Windows or a - -- UTF-8 locale, or this string will be encoded in some non-UTF-8 way and won't match. - putStrLn "Test 3" - let file = "chinese-file-å°è¯´" - print $ map ord file - readFile file >>= putStr - - -- 4) A file name arriving via another file. - -- Again, the file is created with UTF-8 contents, so we read it in that encoding. - -- Once again, on non-Windows this may fail in a non-UTF-8 locale because we could encode the valid - -- filename string into a useless non-UTF-8 byte sequence. - putStrLn "Test 4" - str <- readFileAs utf8 "chinese-name" - let file = dropTrailingSpace str - print $ map ord file - readFile file >>= putStr - -readFileAs :: TextEncoding -> FilePath -> IO String -readFileAs enc fp = do - h <- openFile fp ReadMode - hSetEncoding h enc - hGetContents h - -dropTrailingSpace :: String -> String -dropTrailingSpace = reverse . dropWhile (not . isAlphaNum) . reverse diff --git a/testsuite/tests/lib/IO/3307.stdout b/testsuite/tests/lib/IO/3307.stdout deleted file mode 100644 index 8b26b5ff1d..0000000000 --- a/testsuite/tests/lib/IO/3307.stdout +++ /dev/null @@ -1,12 +0,0 @@ -Test 1 -[99,104,105,110,101,115,101,45,102,105,108,101,45,23567,35828] -Ni hao -Test 2 -[99,104,105,110,101,115,101,45,102,105,108,101,45,23567,35828] -Ni hao -Test 3 -[99,104,105,110,101,115,101,45,102,105,108,101,45,23567,35828] -Ni hao -Test 4 -[99,104,105,110,101,115,101,45,102,105,108,101,45,23567,35828] -Ni hao diff --git a/testsuite/tests/lib/IO/4808.hs b/testsuite/tests/lib/IO/4808.hs deleted file mode 100644 index 5d64762dcd..0000000000 --- a/testsuite/tests/lib/IO/4808.hs +++ /dev/null @@ -1,13 +0,0 @@ -import System.IO -import GHC.IO.Handle -import GHC.IO.FD as FD - -main = do - writeFile "4808.test" "This is some test data" - (fd, _) <- FD.openFile "4808.test" ReadWriteMode False - hdl <- mkDuplexHandle fd "4808.test" Nothing nativeNewlineMode - hClose hdl - (fd2, _) <- FD.openFile "4808.test" ReadWriteMode False - print (fdFD fd == fdFD fd2) -- should be True - hGetLine hdl >>= print -- should fail with an exception - diff --git a/testsuite/tests/lib/IO/4808.stderr b/testsuite/tests/lib/IO/4808.stderr deleted file mode 100644 index 25396c9373..0000000000 --- a/testsuite/tests/lib/IO/4808.stderr +++ /dev/null @@ -1 +0,0 @@ -4808: 4808.test: hGetLine: illegal operation (handle is closed) diff --git a/testsuite/tests/lib/IO/4808.stdout b/testsuite/tests/lib/IO/4808.stdout deleted file mode 100644 index 0ca95142bb..0000000000 --- a/testsuite/tests/lib/IO/4808.stdout +++ /dev/null @@ -1 +0,0 @@ -True diff --git a/testsuite/tests/lib/IO/4855.hs b/testsuite/tests/lib/IO/4855.hs deleted file mode 100644 index fa862aaf14..0000000000 --- a/testsuite/tests/lib/IO/4855.hs +++ /dev/null @@ -1,3 +0,0 @@ -import Debug.Trace - -main = trace "我爱我的电脑" $ return ()
\ No newline at end of file diff --git a/testsuite/tests/lib/IO/4855.stderr b/testsuite/tests/lib/IO/4855.stderr deleted file mode 100644 index 558550e229..0000000000 --- a/testsuite/tests/lib/IO/4855.stderr +++ /dev/null @@ -1 +0,0 @@ -我爱我的电脑 diff --git a/testsuite/tests/lib/IO/4895.hs b/testsuite/tests/lib/IO/4895.hs deleted file mode 100644 index bb37915e19..0000000000 --- a/testsuite/tests/lib/IO/4895.hs +++ /dev/null @@ -1,9 +0,0 @@ -module Main where -import Foreign.Marshal.Alloc -import System.IO - -main = do - h <- openBinaryFile "4895.hs" ReadMode - allocaBytes 10 $ \ptr -> hGetBuf h ptr 10 - some <- allocaBytes 10 $ \ptr -> hGetBufSome h ptr 10 - print some diff --git a/testsuite/tests/lib/IO/4895.stdout b/testsuite/tests/lib/IO/4895.stdout deleted file mode 100644 index f599e28b8a..0000000000 --- a/testsuite/tests/lib/IO/4895.stdout +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/testsuite/tests/lib/IO/IOError001.hs b/testsuite/tests/lib/IO/IOError001.hs deleted file mode 100644 index dee7f31e29..0000000000 --- a/testsuite/tests/lib/IO/IOError001.hs +++ /dev/null @@ -1,7 +0,0 @@ - --- test for a bug in GHC <= 4.08.2: handles were being left locked after --- being shown in an error message. -main = do - getContents - catch getChar (\e -> print e >> return 'x') - catch getChar (\e -> print e >> return 'x') diff --git a/testsuite/tests/lib/IO/IOError001.stdout b/testsuite/tests/lib/IO/IOError001.stdout deleted file mode 100644 index 1e689bb0f9..0000000000 --- a/testsuite/tests/lib/IO/IOError001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -<stdin>: hGetChar: illegal operation (handle is closed) -<stdin>: hGetChar: illegal operation (handle is closed) diff --git a/testsuite/tests/lib/IO/IOError001.stdout-hugs b/testsuite/tests/lib/IO/IOError001.stdout-hugs deleted file mode 100644 index 036084a006..0000000000 --- a/testsuite/tests/lib/IO/IOError001.stdout-hugs +++ /dev/null @@ -1,2 +0,0 @@ -<stdin>: getChar: illegal operation (handle is semi-closed) -<stdin>: getChar: illegal operation (handle is semi-closed) diff --git a/testsuite/tests/lib/IO/IOError002.hs b/testsuite/tests/lib/IO/IOError002.hs deleted file mode 100644 index 144e62783b..0000000000 --- a/testsuite/tests/lib/IO/IOError002.hs +++ /dev/null @@ -1,5 +0,0 @@ --- !!! IOErrors should have Eq defined - -import System.IO - -main = print (userError "urk" == userError "urk") diff --git a/testsuite/tests/lib/IO/IOError002.stdout b/testsuite/tests/lib/IO/IOError002.stdout deleted file mode 100644 index 0ca95142bb..0000000000 --- a/testsuite/tests/lib/IO/IOError002.stdout +++ /dev/null @@ -1 +0,0 @@ -True diff --git a/testsuite/tests/lib/IO/Makefile b/testsuite/tests/lib/IO/Makefile deleted file mode 100644 index 6808f5f868..0000000000 --- a/testsuite/tests/lib/IO/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk - -test.concio001: - $(TEST_HC) $(TEST_HC_OPTS) --make -fforce-recomp -v0 concio001 -o concio001 - (sleep 1; echo x) | ./concio001 - -test.concio001.thr: - $(TEST_HC) $(TEST_HC_OPTS) --make -fforce-recomp -v0 -threaded concio001 -o concio001 - (sleep 1; echo x) | ./concio001 - -# NB. utf8-test should *not* have a final newline. The last char should be 'X'. -utf16-test: utf8-test - iconv -f UTF-8 -t UTF-16 <utf8-test >utf16-test - -utf16le-test: utf8-test - iconv -f UTF-8 -t UTF-16LE <utf8-test >utf16le-test - -utf16be-test: utf8-test - iconv -f UTF-8 -t UTF-16BE <utf8-test >utf16be-test - -utf32-test: utf8-test - iconv -f UTF-8 -t UTF-32 <utf8-test >utf32-test - -utf32le-test: utf8-test - iconv -f UTF-8 -t UTF-32LE <utf8-test >utf32le-test - -utf32be-test: utf8-test - iconv -f UTF-8 -t UTF-32BE <utf8-test >utf32be-test - -utf8-bom-test: utf16-test - iconv -f UTF-16LE -t UTF-8 <utf16-test >utf8-bom-test - -hSetEncoding001.in : latin1 utf8-test utf16le-test utf16be-test utf16-test utf32le-test utf32be-test utf32-test utf8-bom-test - cat >$@ latin1 utf8-test utf16le-test utf16be-test utf16-test utf32-test utf32le-test utf32be-test utf8-bom-test - -environment001-test: - "$(TEST_HC)" --make -fforce-recomp -v0 environment001.hs -o environment001 - GHC_TEST=马克斯 ./environment001 说 - -3307-test: - "$(TEST_HC)" --make -fforce-recomp -v0 3307.hs -o 3307 - echo Ni hao > chinese-file-å°è¯´ - echo chinese-file-å°è¯´ > chinese-name - # The tests are run in whatever the default locale is. This is almost always UTF-8, - # but in cmd on Windows it will be the non-Unicode CP850 locale. - ./3307 chinese-file-å°è¯´ diff --git a/testsuite/tests/lib/IO/T4144.hs b/testsuite/tests/lib/IO/T4144.hs deleted file mode 100644 index ca14363682..0000000000 --- a/testsuite/tests/lib/IO/T4144.hs +++ /dev/null @@ -1,115 +0,0 @@ -{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-} -module Main (main) where - -import Control.Applicative -import Control.Concurrent.MVar -import Control.Monad - -import Data.ByteString (ByteString) -import qualified Data.ByteString as B -import qualified Data.ByteString.Char8 -import Data.ByteString.Char8() -import Data.ByteString.Unsafe as B -import Data.ByteString.Internal (memcpy) -import Data.Typeable (Typeable) -import Data.Word - -import Foreign - -import GHC.IO.Buffer -import GHC.IO.BufferedIO -import GHC.IO.Device -import GHC.IO.Handle - -import System.IO - --- | Create a seakable read-handle from a bytestring -bsHandle :: ByteString -> FilePath -> IO Handle -bsHandle bs fp - = newBsDevice bs >>= \dev -> - mkFileHandle dev fp ReadMode Nothing noNewlineTranslation - -data BSIODevice - = BSIODevice - ByteString - (MVar Int) -- Position - deriving Typeable - -newBsDevice :: ByteString -> IO BSIODevice -newBsDevice bs = BSIODevice bs <$> newMVar 0 - -remaining :: BSIODevice -> IO Int -remaining (BSIODevice bs mPos) - = do - let bsLen = B.length bs - withMVar mPos $ \pos -> return (bsLen - pos) - -sizeBS :: BSIODevice -> Int -sizeBS (BSIODevice bs _) = B.length bs - -seekBS :: BSIODevice -> SeekMode -> Int -> IO () -seekBS dev AbsoluteSeek pos - | pos < 0 = error "Cannot seek to a negative position!" - | pos > sizeBS dev = error "Cannot seek past end of handle!" - | otherwise = case dev of - BSIODevice _ mPos - -> modifyMVar_ mPos $ \_ -> return pos -seekBS dev SeekFromEnd pos = seekBS dev AbsoluteSeek (sizeBS dev - pos) -seekBS dev RelativeSeek pos - = case dev of - BSIODevice _bs mPos - -> modifyMVar_ mPos $ \curPos -> - let newPos = curPos + pos - in if newPos < 0 || newPos > sizeBS dev - then error "Cannot seek outside of handle!" - else return newPos - -tellBS :: BSIODevice -> IO Int -tellBS (BSIODevice _ mPos) = readMVar mPos - -dupBS :: BSIODevice -> IO BSIODevice -dupBS (BSIODevice bs mPos) = BSIODevice bs <$> (readMVar mPos >>= newMVar) - -readBS :: BSIODevice -> Ptr Word8 -> Int -> IO Int -readBS dev@(BSIODevice bs mPos) buff amount - = do - rem <- remaining dev - if amount > rem - then readBS dev buff rem - else B.unsafeUseAsCString bs $ \ptr -> - do - memcpy buff (castPtr ptr) (fromIntegral amount) - modifyMVar_ mPos (return . (+amount)) - return amount - -instance BufferedIO BSIODevice where - newBuffer dev buffState = newByteBuffer (sizeBS dev) buffState - fillReadBuffer dev buff = readBuf dev buff - fillReadBuffer0 dev buff - = do - (amount, buff') <- fillReadBuffer dev buff - return (if amount == 0 then Nothing else Just amount, buff') - -instance RawIO BSIODevice where - read = readBS - readNonBlocking dev buff n = Just `liftM` readBS dev buff n - -instance IODevice BSIODevice where - ready _ True _ = return False -- read only - ready _ False _ = return True -- always ready - - close _ = return () - isTerminal _ = return False - isSeekable _ = return True - seek dev seekMode pos = seekBS dev seekMode (fromIntegral pos) - tell dev = fromIntegral <$> tellBS dev - getSize dev = return $ fromIntegral $ sizeBS dev - setEcho _ _ = error "Not a terminal device" - getEcho _ = error "Not a terminal device" - setRaw _ _ = error "Raw mode not supported" - devType _ = return RegularFile - dup = dupBS - dup2 _ _ = error "Dup2 not supported" - - -main = bsHandle "test" "<fake file>" >>= Data.ByteString.Char8.hGetContents >>= print diff --git a/testsuite/tests/lib/IO/T4144.stdout b/testsuite/tests/lib/IO/T4144.stdout deleted file mode 100644 index 8b8441b91d..0000000000 --- a/testsuite/tests/lib/IO/T4144.stdout +++ /dev/null @@ -1 +0,0 @@ -"test" diff --git a/testsuite/tests/lib/IO/all.T b/testsuite/tests/lib/IO/all.T deleted file mode 100644 index 38cdabc933..0000000000 --- a/testsuite/tests/lib/IO/all.T +++ /dev/null @@ -1,161 +0,0 @@ -# -*- coding: utf-8 -*- - -def expect_fail_if_windows(opts): - f = if_platform('i386-unknown-mingw32', expect_fail); - return f(opts); - -test('IOError001', compose(omit_ways(['ghci']), set_stdin('IOError001.hs')), - compile_and_run, ['']) - -test('IOError002', normal, compile_and_run, ['']) -test('finalization001', normal, compile_and_run, ['']) -test('hClose001', extra_clean(['hClose001.tmp']), compile_and_run, ['']) -test('hClose002', extra_clean(['hClose002.tmp']), compile_and_run, ['']) -test('hClose003', reqlib('unix'), compile_and_run, ['-package unix']) -test('hFileSize001', normal, compile_and_run, ['']) -test('hFileSize002', - [omit_ways(['ghci']), - extra_clean(['hFileSize002.out'])], - compile_and_run, ['']) -test('hFlush001', - extra_clean(['hFlush001.out']), - compile_and_run, ['']) - -test('hGetBuffering001', - compose(omit_ways(['ghci']), set_stdin('hGetBuffering001.hs')), - compile_and_run, ['']) - -test('hGetChar001', normal, compile_and_run, ['']) -test('hGetLine001', set_stdin('hGetLine001.hs'), compile_and_run, ['-cpp']) -test('hGetLine002', normal, compile_and_run, ['']) -test('hGetLine003', normal, compile_and_run, ['']) -test('hGetPosn001', - extra_clean(['hGetPosn001.out']), - compile_and_run, ['-cpp']) -test('hIsEOF001', normal, compile_and_run, ['']) -test('hIsEOF002', extra_clean(['hIsEOF002.out']), compile_and_run, ['-cpp']) - -test('hReady001', normal, compile_and_run, ['-cpp']) - -# hReady002 tests that hReady returns False for a pipe that has no -# data to read. It relies on piping input from 'sleep 1', which doesn't -# work for the 'ghci' way because in that case we already pipe input from -# a script, so hence omit_ways(['ghci']) -test('hReady002', [ no_stdin, cmd_prefix('sleep 1 |'), - omit_ways(['ghci']) ], - compile_and_run, ['']) - -test('hSeek001', normal, compile_and_run, ['']) -test('hSeek002', normal, compile_and_run, ['-cpp']) -test('hSeek003', normal, compile_and_run, ['-cpp']) -test('hSeek004', extra_clean(['hSeek004.out']), compile_and_run, ['-cpp']) - -test('hSetBuffering002', set_stdin('hSetBuffering002.hs'), compile_and_run, ['']) - -test('hSetBuffering003', compose(omit_ways(['ghci']), - set_stdin('hSetBuffering003.hs')), - compile_and_run, ['']) - -test('hSetBuffering004', set_stdin('hSetBuffering004.hs'), compile_and_run, ['']) - -test('ioeGetErrorString001', normal, compile_and_run, ['-cpp']) -test('ioeGetFileName001', normal, compile_and_run, ['-cpp']) -test('ioeGetHandle001', normal, compile_and_run, ['-cpp']) -test('isEOF001', normal, compile_and_run, ['']) - -test('misc001', - [extra_run_opts('misc001.hs misc001.out'), - extra_clean(['misc001.out'])], - compile_and_run, ['']) - -test('openFile001', normal, compile_and_run, ['']) -test('openFile002', exit_code(1), compile_and_run, ['']) -test('openFile003', extra_clean(['openFile003Dir']), compile_and_run, ['']) -test('openFile004', extra_clean(['openFile004.out']), compile_and_run, ['']) -test('openFile005', - [if_compiler_type('hugs', expect_fail), - extra_clean(['openFile005.out1', 'openFile005.out2'])], - compile_and_run, ['']) -test('openFile006', extra_clean(['openFile006.out']), compile_and_run, ['']) -test('openFile007', - [if_compiler_type('hugs', expect_fail), - extra_clean(['openFile007.out'])], - compile_and_run, ['']) -test('openFile008', cmd_prefix('ulimit -n 1024; '), compile_and_run, ['']) - -test('putStr001', normal, compile_and_run, ['']) -test('readFile001', - [if_compiler_type('hugs', expect_fail), - extra_clean(['readFile001.out'])], - compile_and_run, ['']) -test('readwrite001', - extra_clean(['readwrite001.inout']), - compile_and_run, - ['-cpp']) - - -test('readwrite002', - [omit_ways(['ghci']), - set_stdin('readwrite002.hs'), - extra_clean(['readwrite002.inout'])], - compile_and_run, ['-cpp']) - -test('readwrite003', extra_clean(['readwrite003.txt']), compile_and_run, ['']) - -test('hGetBuf001', compose(only_compiler_types(['ghc']), - compose(skip_if_fast, - expect_fail_if_windows)), compile_and_run, ['-package unix']) - -test('hDuplicateTo001', extra_clean(['tmp']), compile_and_run, ['']) - -test('countReaders001', - extra_clean(['countReaders001.txt']), - compile_and_run, ['']) - -test('concio001', skip, run_command, ['$MAKE -s --no-print-directory test.concio001']) -test('concio001.thr', skip, run_command, ['$MAKE -s --no-print-directory test.concio001.thr']) - -test('concio002', reqlib('process'), compile_and_run, ['']) - -test('2122', extra_clean(['2122-test']), compile_and_run, ['']) -test('3307', - [if_msys(expect_fail), # See trac #5599 - extra_clean(['chinese-file-å°è¯´', 'chinese-name'])], - run_command, - ['$MAKE -s --no-print-directory 3307-test']) -test('4855', normal, compile_and_run, ['']) - -test('hSetEncoding001',extra_run_opts('hSetEncoding001.in'), compile_and_run, ['']) -test('decodingerror001',normal, compile_and_run, ['']) -test('decodingerror002',normal, compile_and_run, ['']) - -encoding001Encodings = ["utf8", "utf8_bom", "utf16", "utf16le", - "utf16be", "utf32", "utf32le", "utf32be"] -encoding001CleanFiles = [] -for e in encoding001Encodings: - encoding001CleanFiles.append('encoding001.' + e) -for e1 in encoding001Encodings: - for e2 in encoding001Encodings: - encoding001CleanFiles.append('encoding001.' + e1 + '.' + e2) -test('encoding001', - extra_clean(encoding001CleanFiles), - compile_and_run, ['']) - -test('encoding002', normal, compile_and_run, ['']) - -test('environment001', - [if_msys(expect_fail), # See trac #5599 - extra_clean(['environment001'])], - run_command, - ['$MAKE -s --no-print-directory environment001-test']) - -test('newline001', extra_clean(['newline001.out']), compile_and_run, ['']) - -test('openTempFile001', normal, compile_and_run, ['']) - -test('T4144', normal, compile_and_run, ['']) - -test('encodingerror001', normal, compile_and_run, ['']) - -test('4808', [exit_code(1), extra_clean(['4808.test'])], compile_and_run, ['']) -test('4895', normal, compile_and_run, ['']) diff --git a/testsuite/tests/lib/IO/concio001.hs b/testsuite/tests/lib/IO/concio001.hs deleted file mode 100644 index 786a311ce5..0000000000 --- a/testsuite/tests/lib/IO/concio001.hs +++ /dev/null @@ -1,6 +0,0 @@ -import Control.Concurrent - -main = do - forkIO $ do threadDelay 100000; putStrLn "child" - getLine - putStrLn "parent" diff --git a/testsuite/tests/lib/IO/concio001.stdout b/testsuite/tests/lib/IO/concio001.stdout deleted file mode 100644 index 141a8cd80c..0000000000 --- a/testsuite/tests/lib/IO/concio001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -child -parent diff --git a/testsuite/tests/lib/IO/concio001.thr.stdout b/testsuite/tests/lib/IO/concio001.thr.stdout deleted file mode 100644 index 141a8cd80c..0000000000 --- a/testsuite/tests/lib/IO/concio001.thr.stdout +++ /dev/null @@ -1,2 +0,0 @@ -child -parent diff --git a/testsuite/tests/lib/IO/concio002.hs b/testsuite/tests/lib/IO/concio002.hs deleted file mode 100644 index 60a2ed2a89..0000000000 --- a/testsuite/tests/lib/IO/concio002.hs +++ /dev/null @@ -1,14 +0,0 @@ -import System.Process -import System.IO -import Control.Concurrent - -main = do - (hin,hout,herr,ph) <- runInteractiveProcess "cat" [] Nothing Nothing - forkIO $ do threadDelay 100000 - putStrLn "child" - hFlush stdout - hPutStrLn hin "msg" - hFlush hin - putStrLn "parent1" - hGetLine hout >>= putStrLn - putStrLn "parent2" diff --git a/testsuite/tests/lib/IO/concio002.stdout b/testsuite/tests/lib/IO/concio002.stdout deleted file mode 100644 index 32640aede5..0000000000 --- a/testsuite/tests/lib/IO/concio002.stdout +++ /dev/null @@ -1,4 +0,0 @@ -parent1 -child -msg -parent2 diff --git a/testsuite/tests/lib/IO/countReaders001.hs b/testsuite/tests/lib/IO/countReaders001.hs deleted file mode 100644 index 2648ae77ae..0000000000 --- a/testsuite/tests/lib/IO/countReaders001.hs +++ /dev/null @@ -1,17 +0,0 @@ --- test for trac #629. We need to keep track of how many readers --- there are rather than closing the first read handle causing the --- lock to be released. - -import System.IO -import System.IO.Error - -file = "countReaders001.txt" - -main = do - writeFile file "foo" - - h1 <- openFile file ReadMode - h2 <- openFile file ReadMode - hClose h1 - tryIOError (openFile file AppendMode) >>= print - diff --git a/testsuite/tests/lib/IO/countReaders001.stdout b/testsuite/tests/lib/IO/countReaders001.stdout deleted file mode 100644 index 41644bff37..0000000000 --- a/testsuite/tests/lib/IO/countReaders001.stdout +++ /dev/null @@ -1 +0,0 @@ -Left countReaders001.txt: openFile: resource busy (file is locked) diff --git a/testsuite/tests/lib/IO/countReaders001.stdout-i386-unknown-mingw32 b/testsuite/tests/lib/IO/countReaders001.stdout-i386-unknown-mingw32 deleted file mode 100644 index bf80d9dc12..0000000000 --- a/testsuite/tests/lib/IO/countReaders001.stdout-i386-unknown-mingw32 +++ /dev/null @@ -1 +0,0 @@ -Left countReaders001.txt: openFile: permission denied (Permission denied) diff --git a/testsuite/tests/lib/IO/decodingerror001.hs b/testsuite/tests/lib/IO/decodingerror001.hs deleted file mode 100644 index 6c9dca1489..0000000000 --- a/testsuite/tests/lib/IO/decodingerror001.hs +++ /dev/null @@ -1,22 +0,0 @@ -import Control.Monad -import System.IO -import System.IO.Error -import GHC.IO.Encoding (utf8) -import GHC.IO.Handle (hSetEncoding) - -testfiles = ["decodingerror001.in1", "decodingerror001.in2"] - -main = mapM_ alltests testfiles - -alltests file = mapM (test file) [NoBuffering, - LineBuffering, - BlockBuffering Nothing, - BlockBuffering (Just 9), - BlockBuffering (Just 23) ] - -test file bufmode = do - h <- openFile file ReadMode - hSetEncoding h utf8 - hSetBuffering h bufmode - e <- try $ forever $ hGetChar h >>= putChar - print (e :: Either IOError ()) diff --git a/testsuite/tests/lib/IO/decodingerror001.in1 b/testsuite/tests/lib/IO/decodingerror001.in1 deleted file mode 100644 index 7686e7b2f4..0000000000 --- a/testsuite/tests/lib/IO/decodingerror001.in1 +++ /dev/null @@ -1 +0,0 @@ -UTF8 error:€after error diff --git a/testsuite/tests/lib/IO/decodingerror001.in2 b/testsuite/tests/lib/IO/decodingerror001.in2 deleted file mode 100644 index fe33bd3883..0000000000 --- a/testsuite/tests/lib/IO/decodingerror001.in2 +++ /dev/null @@ -1 +0,0 @@ -UTF8 incomplete sequence at end:ð
\ No newline at end of file diff --git a/testsuite/tests/lib/IO/decodingerror001.stdout b/testsuite/tests/lib/IO/decodingerror001.stdout deleted file mode 100644 index 24ca1a95b0..0000000000 --- a/testsuite/tests/lib/IO/decodingerror001.stdout +++ /dev/null @@ -1,10 +0,0 @@ -UTF8 error:Left decodingerror001.in1: hGetChar: invalid argument (invalid byte sequence) -UTF8 error:Left decodingerror001.in1: hGetChar: invalid argument (invalid byte sequence) -UTF8 error:Left decodingerror001.in1: hGetChar: invalid argument (invalid byte sequence) -UTF8 error:Left decodingerror001.in1: hGetChar: invalid argument (invalid byte sequence) -UTF8 error:Left decodingerror001.in1: hGetChar: invalid argument (invalid byte sequence) -UTF8 incomplete sequence at end:Left decodingerror001.in2: hGetChar: invalid argument (invalid byte sequence) -UTF8 incomplete sequence at end:Left decodingerror001.in2: hGetChar: invalid argument (invalid byte sequence) -UTF8 incomplete sequence at end:Left decodingerror001.in2: hGetChar: invalid argument (invalid byte sequence) -UTF8 incomplete sequence at end:Left decodingerror001.in2: hGetChar: invalid argument (invalid byte sequence) -UTF8 incomplete sequence at end:Left decodingerror001.in2: hGetChar: invalid argument (invalid byte sequence) diff --git a/testsuite/tests/lib/IO/decodingerror002.hs b/testsuite/tests/lib/IO/decodingerror002.hs deleted file mode 100644 index db610bdebd..0000000000 --- a/testsuite/tests/lib/IO/decodingerror002.hs +++ /dev/null @@ -1,23 +0,0 @@ -import Control.Monad -import System.IO -import System.IO.Error -import GHC.IO.Handle (hSetEncoding) - -main = do - -- Explicitly set stdout encoding so that the UTF8//ROUNDTRIP - -- test is always able to write the surrogate byte out without error. - enc <- mkTextEncoding "UTF-8//ROUNDTRIP" - hSetEncoding stdout enc - alltests "decodingerror002.in" - -alltests file = mapM (test file) ["UTF-8", - "UTF-8//IGNORE", - "UTF-8//TRANSLIT", - "UTF-8//ROUNDTRIP"] - -test file enc_name = do - h <- openFile file ReadMode - enc <- mkTextEncoding enc_name - hSetEncoding h enc - e <- try $ forever $ hGetChar h >>= putChar - print (e :: Either IOError ()) diff --git a/testsuite/tests/lib/IO/decodingerror002.in b/testsuite/tests/lib/IO/decodingerror002.in deleted file mode 100644 index 195ee38114..0000000000 --- a/testsuite/tests/lib/IO/decodingerror002.in +++ /dev/null @@ -1 +0,0 @@ -È
\ No newline at end of file diff --git a/testsuite/tests/lib/IO/decodingerror002.stdout b/testsuite/tests/lib/IO/decodingerror002.stdout deleted file mode 100644 index e1cef33d0d..0000000000 --- a/testsuite/tests/lib/IO/decodingerror002.stdout +++ /dev/null @@ -1,4 +0,0 @@ -Left decodingerror002.in: hGetChar: invalid argument (invalid byte sequence) -Left decodingerror002.in: hGetChar: end of file -�Left decodingerror002.in: hGetChar: end of file -ÈLeft decodingerror002.in: hGetChar: end of file diff --git a/testsuite/tests/lib/IO/encoding001.hs b/testsuite/tests/lib/IO/encoding001.hs deleted file mode 100644 index 9480abb09d..0000000000 --- a/testsuite/tests/lib/IO/encoding001.hs +++ /dev/null @@ -1,71 +0,0 @@ -import Control.Monad -import System.IO -import GHC.IO.Encoding -import GHC.IO.Handle -import Data.Bits -import Data.Word -import Data.Char -import System.FilePath -import System.Exit - -file = "encoding001" - -encodings = [(utf8, "utf8"), - (utf8_bom, "utf8_bom"), - (utf16, "utf16"), - (utf16le, "utf16le"), - (utf16be, "utf16be"), - (utf32, "utf32"), - (utf32le, "utf32le"), - (utf32be, "utf32be")] - -main = do - -- make a UTF-32BE file - h <- openBinaryFile (file <.> "utf32be") WriteMode - let expand32 :: Word32 -> [Char] - expand32 x = [ - chr (fromIntegral (x `shiftR` 24) .&. 0xff), - chr (fromIntegral (x `shiftR` 16) .&. 0xff), - chr (fromIntegral (x `shiftR` 8) .&. 0xff), - chr (fromIntegral x .&. 0xff) ] - hPutStr h (concatMap expand32 [ 0, 32 .. 0xD7ff ]) - -- We avoid the private-use characters at 0xEF00..0xEFFF - -- that reserved for GHC's PEP383 roundtripping implementation. - -- - -- The reason is that currently normal text containing those - -- characters will be mangled, even if we aren't using an encoding - -- created using //ROUNDTRIP. - hPutStr h (concatMap expand32 [ 0xE000, 0xE000+32 .. 0xEEFF ]) - hPutStr h (concatMap expand32 [ 0xF000, 0xF000+32 .. 0x10FFFF ]) - hClose h - - -- convert the UTF-32BE file into each other encoding - forM_ encodings $ \(enc,name) -> do - when (name /= "utf32be") $ do - hin <- openFile (file <.> "utf32be") ReadMode - hSetEncoding hin utf32be - hout <- openFile (file <.> name) WriteMode - hSetEncoding hout enc - hGetContents hin >>= hPutStr hout - hClose hin - hClose hout - - forM_ [ (from,to) | from <- encodings, to <- encodings, snd from /= snd to ] - $ \((fromenc,fromname),(toenc,toname)) -> do - hin <- openFile (file <.> fromname) ReadMode - hSetEncoding hin fromenc - hout <- openFile (file <.> toname <.> fromname) WriteMode - hSetEncoding hout toenc - hGetContents hin >>= hPutStr hout - hClose hin - hClose hout - - h1 <- openBinaryFile (file <.> toname) ReadMode - h2 <- openBinaryFile (file <.> toname <.> fromname) ReadMode - str1 <- hGetContents h1 - str2 <- hGetContents h2 - when (str1 /= str2) $ do - putStrLn (file <.> toname ++ " and " ++ file <.> toname <.> fromname ++ " differ") - exitWith (ExitFailure 1) - hClose h1 - hClose h2 diff --git a/testsuite/tests/lib/IO/encoding002.hs b/testsuite/tests/lib/IO/encoding002.hs deleted file mode 100644 index 65d60a3993..0000000000 --- a/testsuite/tests/lib/IO/encoding002.hs +++ /dev/null @@ -1,67 +0,0 @@ -import Control.Monad - -import System.IO -import Control.Exception - -import Foreign.Marshal.Array -import Foreign.Ptr - -import GHC.Foreign -import GHC.IO.Encoding (TextEncoding, mkTextEncoding) - -import Data.Char -import Data.Word - -import Prelude hiding (catch) - - -decode :: TextEncoding -> [Word8] -> IO String -decode enc xs = withArrayLen xs (\sz p -> peekCStringLen enc (castPtr p, sz)) `catch` \e -> return (show (e :: IOException)) - -encode :: TextEncoding -> String -> IO [Word8] -encode enc cs = withCStringLen enc cs (\(p, sz) -> peekArray sz (castPtr p)) `catch` \e -> return (const [] (e :: IOException)) - -asc :: Char -> Word8 -asc = fromIntegral . ord - -families = [ ([asc 'H', asc 'i', 0xED, 0xB2, 0x80, asc '!'], - ["UTF-8", "UTF-8//IGNORE", "UTF-8//TRANSLIT", "UTF-8//ROUNDTRIP"]) - , ([asc 'H', 0, asc 'i', 0, 0xFF, 0xDF, 0xFF, 0xDF, asc '!', 0], - ["UTF-16LE", "UTF-16LE//IGNORE", "UTF-16LE//TRANSLIT", "UTF-16LE//ROUNDTRIP"]) - , ([0, asc 'H', 0, asc 'i', 0xDF, 0xFF, 0xDF, 0xFF, 0, asc '!'], - ["UTF-16BE", "UTF-16BE//IGNORE", "UTF-16BE//TRANSLIT", "UTF-16BE//ROUNDTRIP"]) - , ([asc 'H', 0, 0, 0, asc 'i', 0, 0, 0, 0xED, 0xB2, 0x80, 0, asc '!', 0, 0, 0], - ["UTF-32LE", "UTF-32LE//IGNORE", "UTF-32LE//TRANSLIT", "UTF-32LE//ROUNDTRIP"]) - , ([0, 0, 0, asc 'H', 0, 0, 0, asc 'i', 0, 0x80, 0xB2, 0xED, 0, 0, 0, asc '!'], - ["UTF-32BE", "UTF-32BE//IGNORE", "UTF-32BE//TRANSLIT", "UTF-32BE//ROUNDTRIP"]) - ] - -main = do - surrogate_enc <- mkTextEncoding "UTF-8//ROUNDTRIP" - - -- Test that invalid input is correctly roundtripped as surrogates - -- This only works for the UTF-8 UTF since it is the only UTF which - -- is an ASCII superset. - putStrLn $ "== UTF-8: roundtripping" - let invalid_bytes = [asc 'H', asc 'i', 0xED, 0xB2, 0x80, asc '!'] - surrogates <- decode surrogate_enc invalid_bytes - invalid_bytes' <- encode surrogate_enc surrogates - print invalid_bytes - print surrogates - print invalid_bytes' - print (invalid_bytes == invalid_bytes') - putStrLn "" - - forM families $ \(invalid_bytes, enc_names) -> do - encs <- mapM mkTextEncoding enc_names - let name = head enc_names - - -- How we deal with decoding errors in the various modes: - putStrLn $ "== " ++ name ++ ": decoding" - forM encs $ \enc -> decode enc invalid_bytes >>= print - - -- How about encoding errors, particularly those from embedded surrogates? - putStrLn $ "== " ++ name ++ ": encoding" - forM encs $ \enc -> encode enc "Hi\xDC80!" >>= print - - putStrLn "" diff --git a/testsuite/tests/lib/IO/encoding002.stdout b/testsuite/tests/lib/IO/encoding002.stdout deleted file mode 100644 index 0cc885baa0..0000000000 --- a/testsuite/tests/lib/IO/encoding002.stdout +++ /dev/null @@ -1,61 +0,0 @@ -== UTF-8: roundtripping -[72,105,237,178,128,33] -"Hi\56557\56498\56448!" -[72,105,237,178,128,33] -True - -== UTF-8: decoding -"recoverDecode: invalid argument (invalid byte sequence)" -"Hi!" -"Hi\65533\65533\65533!" -"Hi\56557\56498\56448!" -== UTF-8: encoding -[] -[72,105,33] -[72,105,63,33] -[72,105,128,33] - -== UTF-16LE: decoding -"recoverDecode: invalid argument (invalid byte sequence)" -"Hi\65503\8671" -"Hi\65533\65503\8671\65533" -"Hi\56575\65503\8671\NUL" -== UTF-16LE: encoding -[] -[72,0,105,0,33,0] -[72,0,105,0,63,0,33,0] -[72,0,105,0,128,33,0] - -== UTF-16BE: decoding -"recoverDecode: invalid argument (invalid byte sequence)" -"Hi\65503\65280" -"Hi\65533\65503\65280\65533" -"Hi\56543\65503\65280!" -== UTF-16BE: encoding -[] -[0,72,0,105,0,33] -[0,72,0,105,0,63,0,33] -[0,72,0,105,128,0,33] - -== UTF-32LE: decoding -"recoverDecode: invalid argument (invalid byte sequence)" -"Hi\8448" -"Hi\65533\65533\65533\8448\65533" -"Hi\56557\56498\56448\8448\NUL" -== UTF-32LE: encoding -[] -[72,0,0,0,105,0,0,0,33,0,0,0] -[72,0,0,0,105,0,0,0,63,0,0,0,33,0,0,0] -[72,0,0,0,105,0,0,0,128,33,0,0,0] - -== UTF-32BE: decoding -"recoverDecode: invalid argument (invalid byte sequence)" -"Hi!" -"Hi\65533\65533\65533\65533!" -"Hi\NUL\56448\56498\56557!" -== UTF-32BE: encoding -[] -[0,0,0,72,0,0,0,105,0,0,0,33] -[0,0,0,72,0,0,0,105,0,0,0,63,0,0,0,33] -[0,0,0,72,0,0,0,105,128,0,0,0,33] - diff --git a/testsuite/tests/lib/IO/encodingerror001.hs b/testsuite/tests/lib/IO/encodingerror001.hs deleted file mode 100644 index 327b490adb..0000000000 --- a/testsuite/tests/lib/IO/encodingerror001.hs +++ /dev/null @@ -1,27 +0,0 @@ -import System.IO -import System.IO.Error -import Text.Printf -import Control.Monad - -main = do - hSetEncoding stdout latin1 - forM [NoBuffering, - LineBuffering, - BlockBuffering Nothing, - BlockBuffering (Just 3), - BlockBuffering (Just 9), - BlockBuffering (Just 32)] $ \b -> do - hSetBuffering stdout b - checkedPutStr "test 1\n" - checkedPutStr "Ä›\n" -- nothing gets written - checkedPutStr "test 2\n" - checkedPutStr "HÎllo\n" -- we should write at least the 'H' - checkedPutStr "test 3\n" - checkedPutStr "Hello αβγ\n" -- we should write at least the "Hello " - -checkedPutStr str = do - r <- try $ putStr str - case r of - Right _ -> return () - Left e -> printf "Caught %s while trying to write %s\n" - (show e) (show str) diff --git a/testsuite/tests/lib/IO/encodingerror001.stdout b/testsuite/tests/lib/IO/encodingerror001.stdout deleted file mode 100644 index 7406cd9168..0000000000 --- a/testsuite/tests/lib/IO/encodingerror001.stdout +++ /dev/null @@ -1,36 +0,0 @@ -test 1 -Caught <stdout>: hPutChar: invalid argument (invalid character) while trying to write "\283\n" -test 2 -HCaught <stdout>: hPutChar: invalid argument (invalid character) while trying to write "H\941llo\n" -test 3 -Hello Caught <stdout>: hPutChar: invalid argument (invalid character) while trying to write "Hello \945\946\947\n" -test 1 -Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "\283\n" -test 2 -HCaught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "H\941llo\n" -test 3 -Hello Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "Hello \945\946\947\n" -test 1 -Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "\283\n" -test 2 -HCaught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "H\941llo\n" -test 3 -Hello Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "Hello \945\946\947\n" -test 1 -Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "\283\n" -test 2 -HCaught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "H\941llo\n" -test 3 -Hello Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "Hello \945\946\947\n" -test 1 -Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "\283\n" -test 2 -HCaught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "H\941llo\n" -test 3 -Hello Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "Hello \945\946\947\n" -test 1 -Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "\283\n" -test 2 -HCaught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "H\941llo\n" -test 3 -Hello Caught <stdout>: commitBuffer: invalid argument (invalid character) while trying to write "Hello \945\946\947\n" diff --git a/testsuite/tests/lib/IO/environment001.hs b/testsuite/tests/lib/IO/environment001.hs deleted file mode 100644 index 11d7912cdd..0000000000 --- a/testsuite/tests/lib/IO/environment001.hs +++ /dev/null @@ -1,16 +0,0 @@ -import System.Environment - -main = do - var0 <- getEnv "GHC_TEST" - putStrLn var0 - -- The length proves that we actually decoded it properly, not just read it - -- in as latin1 or something (#3308, #3307) - putStrLn ("Test 1: " ++ show (length var0)) - - [arg0] <- getArgs - putStrLn arg0 - putStrLn ("Test 2: " ++ show (length arg0)) - - [arg1] <- withArgs ["ä½ å¥½!"] getArgs - putStrLn arg1 - putStrLn ("Test 3: " ++ show (length arg1)) diff --git a/testsuite/tests/lib/IO/environment001.stdout b/testsuite/tests/lib/IO/environment001.stdout deleted file mode 100644 index 2434d0c14d..0000000000 --- a/testsuite/tests/lib/IO/environment001.stdout +++ /dev/null @@ -1,6 +0,0 @@ -马克斯 -Test 1: 3 -说 -Test 2: 1 -ä½ å¥½! -Test 3: 3 diff --git a/testsuite/tests/lib/IO/finalization001.hs b/testsuite/tests/lib/IO/finalization001.hs deleted file mode 100644 index 44828a68c1..0000000000 --- a/testsuite/tests/lib/IO/finalization001.hs +++ /dev/null @@ -1,26 +0,0 @@ ---- !!! test for bug in handle finalization fixed in ---- !!! 1.60 +1 -2 fptools/ghc/lib/std/PrelHandle.lhs ---- !!! 1.15 +4 -10 fptools/ghc/lib/std/PrelIO.lhs - -module Main (main) where - -import System.IO - -doTest :: IO () -doTest = do - sd <- openFile "finalization001.hs" ReadMode - result <- hGetContents sd - slurp result - hClose sd - if "" `elem` lines (filter (/= '\r') result) - then - putStrLn "ok" - else - putStrLn "fail" - -slurp :: String -> IO () -slurp [] = return () -slurp (x:xs) = x `seq` slurp xs - -main :: IO () -main = sequence_ (take 200 (repeat doTest)) diff --git a/testsuite/tests/lib/IO/finalization001.stdout b/testsuite/tests/lib/IO/finalization001.stdout deleted file mode 100644 index ec04732f97..0000000000 --- a/testsuite/tests/lib/IO/finalization001.stdout +++ /dev/null @@ -1,200 +0,0 @@ -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/testsuite/tests/lib/IO/hClose001.hs b/testsuite/tests/lib/IO/hClose001.hs deleted file mode 100644 index 8d31447e95..0000000000 --- a/testsuite/tests/lib/IO/hClose001.hs +++ /dev/null @@ -1,8 +0,0 @@ -import System.IO -import System.IO.Error - -main = do - h <- openFile "hClose001.tmp" WriteMode - hPutStr h "junk" - hClose h - hPutStr h "junk" `catchIOError` \ err -> if isIllegalOperation err then putStr "Okay\n" else error "Not okay\n" diff --git a/testsuite/tests/lib/IO/hClose001.stdout b/testsuite/tests/lib/IO/hClose001.stdout deleted file mode 100644 index 1ddd42bbe7..0000000000 --- a/testsuite/tests/lib/IO/hClose001.stdout +++ /dev/null @@ -1 +0,0 @@ -Okay diff --git a/testsuite/tests/lib/IO/hClose002.hs b/testsuite/tests/lib/IO/hClose002.hs deleted file mode 100644 index ebf26b4663..0000000000 --- a/testsuite/tests/lib/IO/hClose002.hs +++ /dev/null @@ -1,32 +0,0 @@ -import System.IO -import Control.Exception - -import qualified GHC.IO.Device as IODevice -import GHC.IO.Handle -import GHC.IO.Handle.Internals -import GHC.IO.Handle.Types -import System.Posix.Internals - -main = do - h <- openFile "hClose002.tmp" WriteMode - -- close the FD without telling the IO library: - naughtyClose h - -- first hClose will raise an exception, but close the - -- Handle anyway: - showPossibleException (hClose h) - -- second hClose should success (Handle is already closed) - showPossibleException (hClose h) - -- this should succeed (checking that the lock on the file has - -- been released: - h <- openFile "hClose002.tmp" ReadMode - showPossibleException (hClose h) - showPossibleException (hClose h) - -showPossibleException :: IO () -> IO () -showPossibleException f = do e <- try f - print (e :: Either SomeException ()) - -naughtyClose h = - withHandle_ "naughtyClose" h $ \ Handle__{haDevice=dev} -> do - IODevice.close dev - diff --git a/testsuite/tests/lib/IO/hClose002.stdout b/testsuite/tests/lib/IO/hClose002.stdout deleted file mode 100644 index f26be4ab07..0000000000 --- a/testsuite/tests/lib/IO/hClose002.stdout +++ /dev/null @@ -1,4 +0,0 @@ -Left hClose002.tmp: hClose: invalid argument (Bad file descriptor) -Right () -Right () -Right () diff --git a/testsuite/tests/lib/IO/hClose002.stdout-i386-unknown-solaris2 b/testsuite/tests/lib/IO/hClose002.stdout-i386-unknown-solaris2 deleted file mode 100644 index 39a24de031..0000000000 --- a/testsuite/tests/lib/IO/hClose002.stdout-i386-unknown-solaris2 +++ /dev/null @@ -1,4 +0,0 @@ -Left hClose002.tmp: hClose: invalid argument (Bad file number) -Right () -Right () -Right () diff --git a/testsuite/tests/lib/IO/hClose003.hs b/testsuite/tests/lib/IO/hClose003.hs deleted file mode 100644 index cbaf49d6db..0000000000 --- a/testsuite/tests/lib/IO/hClose003.hs +++ /dev/null @@ -1,42 +0,0 @@ --- Test for #3128, file descriptor leak when hClose fails - -import System.IO -import Control.Exception -import Data.Char - -import System.Posix -import qualified GHC.IO.Device as IODevice -import GHC.IO.Handle -import GHC.IO.Handle.Internals -import GHC.IO.Handle.Types -import System.Posix.Internals - -main = do - (read,write) <- createPipe - hread <- fdToHandle read - hwrite <- fdToHandle write - - -- close the FD without telling the IO library: - showPossibleException (hClose hread) - hIsOpen hread >>= print - - -- put some data in the Handle's write buffer: - hPutStr hwrite "testing" - -- now try to close the Handle: - showPossibleException (hClose hwrite) - hIsOpen hwrite >>= print - -showPossibleException :: IO () -> IO () -showPossibleException f = do - e <- try f - putStrLn (sanitise (show (e :: Either SomeException ()))) - where - -- 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 - IODevice.close dev diff --git a/testsuite/tests/lib/IO/hClose003.stdout b/testsuite/tests/lib/IO/hClose003.stdout deleted file mode 100644 index d12f84d7d7..0000000000 --- a/testsuite/tests/lib/IO/hClose003.stdout +++ /dev/null @@ -1,4 +0,0 @@ -Right () -False -Left <file descriptor: X>: hClose: resource vanished (Broken pipe) -False diff --git a/testsuite/tests/lib/IO/hDuplicateTo001.hs b/testsuite/tests/lib/IO/hDuplicateTo001.hs deleted file mode 100644 index 5a1484a012..0000000000 --- a/testsuite/tests/lib/IO/hDuplicateTo001.hs +++ /dev/null @@ -1,24 +0,0 @@ -import GHC.Handle -import GHC.IOBase -import System.IO -import Control.Concurrent.MVar -import Data.Typeable -import qualified GHC.IO.FD as FD - -main = do - h <- openFile "tmp" WriteMode - hDuplicateTo h stdout - - fdh <- getfd h - fdstdout <- getfd stdout - hPutStrLn stderr ("h: " ++ show (fdh /= fdstdout) ++ "\nstdout: " ++ show fdstdout) - - hClose h - putStrLn "bla" - - -getfd h@(FileHandle _ mvar) = do - withMVar mvar $ \h__@Handle__{haDevice=dev} -> - case cast dev of - Just fd -> return (FD.fdFD fd) - Nothing -> error "getfd" diff --git a/testsuite/tests/lib/IO/hDuplicateTo001.stderr b/testsuite/tests/lib/IO/hDuplicateTo001.stderr deleted file mode 100644 index 14a31438a6..0000000000 --- a/testsuite/tests/lib/IO/hDuplicateTo001.stderr +++ /dev/null @@ -1,2 +0,0 @@ -h: True -stdout: 1 diff --git a/testsuite/tests/lib/IO/hFileSize001.hs b/testsuite/tests/lib/IO/hFileSize001.hs deleted file mode 100644 index 62b3e88b9c..0000000000 --- a/testsuite/tests/lib/IO/hFileSize001.hs +++ /dev/null @@ -1,8 +0,0 @@ -import System.IO - --- !!! test hFileSize - -main = do - h <- openFile "hFileSize001.hs" ReadMode - sz <- hFileSize h - print sz diff --git a/testsuite/tests/lib/IO/hFileSize001.stdout b/testsuite/tests/lib/IO/hFileSize001.stdout deleted file mode 100644 index 94361d49fd..0000000000 --- a/testsuite/tests/lib/IO/hFileSize001.stdout +++ /dev/null @@ -1 +0,0 @@ -132 diff --git a/testsuite/tests/lib/IO/hFileSize001.stdout-mingw b/testsuite/tests/lib/IO/hFileSize001.stdout-mingw deleted file mode 100644 index 6a4573e805..0000000000 --- a/testsuite/tests/lib/IO/hFileSize001.stdout-mingw +++ /dev/null @@ -1 +0,0 @@ -133 diff --git a/testsuite/tests/lib/IO/hFileSize002.hs b/testsuite/tests/lib/IO/hFileSize002.hs deleted file mode 100644 index 6c1ad2f57a..0000000000 --- a/testsuite/tests/lib/IO/hFileSize002.hs +++ /dev/null @@ -1,35 +0,0 @@ --- !!! Testing IO.hFileSize -module Main(main) where - -import Control.Monad -import System.Directory ( removeFile, doesFileExist ) -import System.IO - -main = do - sz <- hFileSize stdin `catch` (\ _ -> return (-1)) - print sz - let fn = "hFileSize002.out" - f <- doesFileExist fn - when f (removeFile fn) - hdl <- openFile fn WriteMode - hPutStr hdl "file_size" - -- with default buffering - sz <- hFileSize hdl - print sz - - hSetBuffering hdl NoBuffering - hPutStr hdl "file_size" - -- with no buffering - sz <- hFileSize hdl - print sz - hSetBuffering hdl LineBuffering - hPutStr hdl "file_size" - -- with line buffering - sz <- hFileSize hdl - print sz - hSetBuffering hdl (BlockBuffering (Just 4)) - -- with block buffering - hPutStr hdl "file_size" - sz <- hFileSize hdl - print sz - hClose hdl diff --git a/testsuite/tests/lib/IO/hFileSize002.stdout b/testsuite/tests/lib/IO/hFileSize002.stdout deleted file mode 100644 index 23dd734048..0000000000 --- a/testsuite/tests/lib/IO/hFileSize002.stdout +++ /dev/null @@ -1,5 +0,0 @@ --1 -9 -18 -27 -36 diff --git a/testsuite/tests/lib/IO/hFlush001.hs b/testsuite/tests/lib/IO/hFlush001.hs deleted file mode 100644 index 78c7b7eeb3..0000000000 --- a/testsuite/tests/lib/IO/hFlush001.hs +++ /dev/null @@ -1,31 +0,0 @@ --- !!! Flushing -module Main(main) where - -import Control.Monad -import System.Directory ( removeFile, doesFileExist ) -import System.IO - -main = do - hFlush stdin `catch` \ _ -> putStrLn "No can do - flushing read-only handles isn't legal" - putStr "Hello," - hFlush stdout - putStr "Hello - " - hFlush stderr - hdl <- openFile "hFlush001.hs" ReadMode - hFlush hdl `catch` \ _ -> putStrLn "No can do - flushing read-only handles isn't legal" - hClose hdl - remove - hdl <- openFile "hFlush001.out" WriteMode - hFlush hdl - hClose hdl - remove - hdl <- openFile "hFlush001.out" AppendMode - hFlush hdl - hClose hdl - remove - hdl <- openFile "hFlush001.out" ReadWriteMode - hFlush hdl - hClose hdl - where remove = do - f <- doesFileExist "hFlush001.out" - when f (removeFile "hFlush001.out") diff --git a/testsuite/tests/lib/IO/hFlush001.stdout b/testsuite/tests/lib/IO/hFlush001.stdout deleted file mode 100644 index 0954a7a0b4..0000000000 --- a/testsuite/tests/lib/IO/hFlush001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -No can do - flushing read-only handles isn't legal -Hello,Hello - No can do - flushing read-only handles isn't legal diff --git a/testsuite/tests/lib/IO/hGetBuf001.hs b/testsuite/tests/lib/IO/hGetBuf001.hs deleted file mode 100644 index eea599ea74..0000000000 --- a/testsuite/tests/lib/IO/hGetBuf001.hs +++ /dev/null @@ -1,218 +0,0 @@ --- !!! Testing hGetBuf(NonBlocking), hPutBuf(NonBlocking) - -import System.Posix -import System.IO -import Control.Concurrent -import Foreign -import Foreign.C -import System.Exit -import Control.Exception -import Control.Monad - - -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") - - zipWithM_ ($) - [ f rbuf wbuf - | f <- [hGetBufTest, hGetBufNBTest, hGetBufSomeTest], - rbuf <- [buf1,buf2,buf3], - wbuf <- [buf1,buf2,buf3] - ] - [1..] - -msg = "hello!" -msg_length = length msg - -buf1 = NoBuffering -buf2 = BlockBuffering (Just 5) -buf3 = BlockBuffering (Just 10) - --- chosen to be larger than buf2 & smaller than buf3, so that we exercise --- all code paths: -read_size = 8 :: Int - --- ---------------------------------------------------------------------------- - --- hGetBuf/hPutBuf: --- - test that it always reads all the data that is available --- (with buffer size <, =, > message size). --- - test that at the EOF, it returns a short read. --- - the writing end is using hPutBuf, with various buffer sizes, and --- doing an hFlush at the end of each write. - -hGetBufTest rbuf wbuf n = do - (read,write) <- createPipe - hread <- fdToHandle read - hwrite <- fdToHandle write - m1 <- newEmptyMVar - m2 <- newEmptyMVar - finished <- newEmptyMVar - hSetBuffering hread rbuf - hSetBuffering hwrite wbuf - forkIO (readProc m1 m2 finished hread) - writeProc m1 m2 hwrite - takeMVar finished - putStrLn ("test " ++ show n ++ " OK") - - -readProc :: MVar () -> MVar () -> MVar () -> Handle -> IO () -readProc m1 m2 finished h = do - buf <- mallocBytes 20 - 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) - loop 100 - hPutStr stdout "\n" - putMVar m2 (); takeMVar m1 - r <- hGetBuf h buf read_size -- EOF, should get short read - s <- peekCStringLen (buf,r) - putStrLn ("got " ++ show r ++ ": " ++ s) - r <- hGetBuf h buf read_size -- EOF, should get zero-length read - s <- peekCStringLen (buf,r) - putStrLn ("got " ++ show r ++ ": " ++ s) - hClose h - putMVar finished () - -writeProc :: MVar () -> MVar () -> Handle -> IO () -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) - - loop 100 - takeMVar m2 - withCString "end" $ \s -> do - hPutBuf h s 3 - putMVar m1 () - hClose h - --- ----------------------------------------------------------------------------- --- hGetBufNonBlocking: - -hGetBufNBTest rbuf wbuf n = do - (read,write) <- createPipe - hread <- fdToHandle read - hwrite <- fdToHandle write - m1 <- newEmptyMVar - m2 <- newEmptyMVar - finished <- newEmptyMVar - hSetBuffering hread rbuf - hSetBuffering hwrite wbuf - forkIO (readProcNB m1 m2 finished hread) - writeProcNB m1 m2 hwrite - takeMVar finished - putStrLn ("test " ++ show n ++ " OK") - - -readProcNB :: MVar () -> MVar () -> MVar () -> Handle -> IO () -readProcNB m1 m2 finished h = do - buf <- mallocBytes 20 - - -- first, test that we can do a non-blocking read: - r <- hGetBufNonBlocking h buf read_size - s <- peekCStringLen (buf,r) - putStrLn ("got " ++ show r ++ ": " ++ s) - - 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) - loop 100 - hPutStr stdout "\n" - putMVar m2 (); takeMVar m1 - r <- hGetBufNonBlocking h buf read_size -- EOF, should get short read - s <- peekCStringLen (buf,r) - putStrLn ("got " ++ show r ++ ": " ++ s) - r <- hGetBufNonBlocking h buf read_size -- EOF, should get zero-length read - s <- peekCStringLen (buf,r) - putStrLn ("got " ++ show r ++ ": " ++ s) - hClose h - putMVar finished () - -writeProcNB :: MVar () -> MVar () -> Handle -> IO () -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) - - loop 100 - takeMVar m2 - withCString "end" $ \s -> do - hPutBuf h s 3 - hFlush h - putMVar m1 () - hClose h - --- ----------------------------------------------------------------------------- --- hGetBufSome: - -hGetBufSomeTest rbuf wbuf n = do - (read,write) <- createPipe - hread <- fdToHandle read - hwrite <- fdToHandle write - m1 <- newEmptyMVar - m2 <- newEmptyMVar - finished <- newEmptyMVar - hSetBuffering hread rbuf - hSetBuffering hwrite wbuf - forkIO (readProcSome m1 m2 finished hread) - writeProcNB m1 m2 hwrite - takeMVar finished - putStrLn ("test " ++ show n ++ " OK") - - -readProcSome :: MVar () -> MVar () -> MVar () -> Handle -> IO () -readProcSome m1 m2 finished h = do - buf <- mallocBytes 20 - - 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) - loop 100 - hPutStr stdout "\n" - putMVar m2 (); takeMVar m1 - r <- hGetBufSome h buf read_size -- EOF, should get short read - s <- peekCStringLen (buf,r) - putStrLn ("got " ++ show r ++ ": " ++ s) - r <- hGetBufSome h buf read_size -- EOF, should get zero-length read - s <- peekCStringLen (buf,r) - putStrLn ("got " ++ show r ++ ": " ++ s) - hClose h - putMVar finished () diff --git a/testsuite/tests/lib/IO/hGetBuf001.stdout b/testsuite/tests/lib/IO/hGetBuf001.stdout deleted file mode 100644 index 694ff4eedf..0000000000 --- a/testsuite/tests/lib/IO/hGetBuf001.stdout +++ /dev/null @@ -1,117 +0,0 @@ -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 1 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 2 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 3 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 4 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 5 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 6 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 7 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 8 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 9 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 10 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 11 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 12 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 13 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 14 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 15 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 16 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 17 OK -got 0: -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 18 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 19 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 20 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 21 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 22 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 23 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 24 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 25 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 26 OK -100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -got 3: end -got 0: -test 27 OK diff --git a/testsuite/tests/lib/IO/hGetBuffering001.hs b/testsuite/tests/lib/IO/hGetBuffering001.hs deleted file mode 100644 index 83188b2796..0000000000 --- a/testsuite/tests/lib/IO/hGetBuffering001.hs +++ /dev/null @@ -1,21 +0,0 @@ -import System.IO - -main = - sequence (map hIsOpen [stdin, stdout, stderr]) >>= \ opens -> - print opens >> - sequence (map hIsClosed [stdin, stdout, stderr]) >>= \ closeds -> - print closeds >> - sequence (map hIsReadable [stdin, stdout, stderr]) >>= \ readables -> - print readables >> - sequence (map hIsWritable [stdin, stdout, stderr]) >>= \ writables -> - print writables >> - sequence (map hIsBlockBuffered [stdin, stdout, stderr]) >>= \ buffereds -> - print buffereds >> - sequence (map hIsLineBuffered [stdin, stdout, stderr]) >>= \ buffereds -> - print buffereds >> - sequence (map hIsNotBuffered [stdin, stdout, stderr]) >>= \ buffereds -> - print buffereds - where - hIsBlockBuffered h = hGetBuffering h >>= \ b -> return $ case b of { BlockBuffering _ -> True; _ -> False } - hIsLineBuffered h = hGetBuffering h >>= \ b -> return $ case b of { LineBuffering -> True; _ -> False } - hIsNotBuffered h = hGetBuffering h >>= \ b -> return $ case b of { NoBuffering -> True; _ -> False } diff --git a/testsuite/tests/lib/IO/hGetBuffering001.stdout b/testsuite/tests/lib/IO/hGetBuffering001.stdout deleted file mode 100644 index 75b9a133d9..0000000000 --- a/testsuite/tests/lib/IO/hGetBuffering001.stdout +++ /dev/null @@ -1,7 +0,0 @@ -[True,True,True] -[False,False,False] -[True,False,False] -[False,True,True] -[True,True,False] -[False,False,False] -[False,False,True] diff --git a/testsuite/tests/lib/IO/hGetChar001.hs b/testsuite/tests/lib/IO/hGetChar001.hs deleted file mode 100644 index f5ca666828..0000000000 --- a/testsuite/tests/lib/IO/hGetChar001.hs +++ /dev/null @@ -1,18 +0,0 @@ -import System.IO - -main = do - hSetBuffering stdout NoBuffering - putStr "Enter an integer: " - x1 <- readLine - putStr "Enter another integer: " - x2 <- readLine - putStr ("Their sum is " ++ show (read x1 + read x2 :: Int) ++ "\n") - - 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) diff --git a/testsuite/tests/lib/IO/hGetChar001.stdin b/testsuite/tests/lib/IO/hGetChar001.stdin deleted file mode 100644 index 2510fcaec3..0000000000 --- a/testsuite/tests/lib/IO/hGetChar001.stdin +++ /dev/null @@ -1,2 +0,0 @@ -42 --7 diff --git a/testsuite/tests/lib/IO/hGetChar001.stdout b/testsuite/tests/lib/IO/hGetChar001.stdout deleted file mode 100644 index 47d4185c64..0000000000 --- a/testsuite/tests/lib/IO/hGetChar001.stdout +++ /dev/null @@ -1 +0,0 @@ -Enter an integer: Enter another integer: Their sum is 35 diff --git a/testsuite/tests/lib/IO/hGetLine001.hs b/testsuite/tests/lib/IO/hGetLine001.hs deleted file mode 100644 index b5950623ea..0000000000 --- a/testsuite/tests/lib/IO/hGetLine001.hs +++ /dev/null @@ -1,25 +0,0 @@ --- !!! testing hGetLine - -import System.IO - --- one version of 'cat' -main = do - let loop h = do b <- hIsEOF h - if b then return () - else do l <- hGetLine h; putStrLn l; loop h - loop stdin - - h <- openFile "hGetLine001.hs" ReadMode - - hSetBinaryMode stdout True - - hSetBuffering h NoBuffering - loop h - - hSeek h AbsoluteSeek 0 - hSetBuffering h LineBuffering - loop h - - hSeek h AbsoluteSeek 0 - hSetBuffering h (BlockBuffering (Just 83)) - loop h diff --git a/testsuite/tests/lib/IO/hGetLine001.stdout b/testsuite/tests/lib/IO/hGetLine001.stdout deleted file mode 100644 index 3e023db8f5..0000000000 --- a/testsuite/tests/lib/IO/hGetLine001.stdout +++ /dev/null @@ -1,100 +0,0 @@ --- !!! testing hGetLine
-
-import System.IO
-
--- one version of 'cat'
-main = do
- let loop h = do b <- hIsEOF h
- if b then return ()
- else do l <- hGetLine h; putStrLn l; loop h
- loop stdin
-
- h <- openFile "hGetLine001.hs" ReadMode
-
- hSetBinaryMode stdout True
-
- hSetBuffering h NoBuffering
- loop h
-
- hSeek h AbsoluteSeek 0
- hSetBuffering h LineBuffering
- loop h
-
- hSeek h AbsoluteSeek 0
- hSetBuffering h (BlockBuffering (Just 83))
- loop h
--- !!! testing hGetLine
-
-import System.IO
-
--- one version of 'cat'
-main = do
- let loop h = do b <- hIsEOF h
- if b then return ()
- else do l <- hGetLine h; putStrLn l; loop h
- loop stdin
-
- h <- openFile "hGetLine001.hs" ReadMode
-
- hSetBinaryMode stdout True
-
- hSetBuffering h NoBuffering
- loop h
-
- hSeek h AbsoluteSeek 0
- hSetBuffering h LineBuffering
- loop h
-
- hSeek h AbsoluteSeek 0
- hSetBuffering h (BlockBuffering (Just 83))
- loop h
--- !!! testing hGetLine
-
-import System.IO
-
--- one version of 'cat'
-main = do
- let loop h = do b <- hIsEOF h
- if b then return ()
- else do l <- hGetLine h; putStrLn l; loop h
- loop stdin
-
- h <- openFile "hGetLine001.hs" ReadMode
-
- hSetBinaryMode stdout True
-
- hSetBuffering h NoBuffering
- loop h
-
- hSeek h AbsoluteSeek 0
- hSetBuffering h LineBuffering
- loop h
-
- hSeek h AbsoluteSeek 0
- hSetBuffering h (BlockBuffering (Just 83))
- loop h
--- !!! testing hGetLine
-
-import System.IO
-
--- one version of 'cat'
-main = do
- let loop h = do b <- hIsEOF h
- if b then return ()
- else do l <- hGetLine h; putStrLn l; loop h
- loop stdin
-
- h <- openFile "hGetLine001.hs" ReadMode
-
- hSetBinaryMode stdout True
-
- hSetBuffering h NoBuffering
- loop h
-
- hSeek h AbsoluteSeek 0
- hSetBuffering h LineBuffering
- loop h
-
- hSeek h AbsoluteSeek 0
- hSetBuffering h (BlockBuffering (Just 83))
- loop h
diff --git a/testsuite/tests/lib/IO/hGetLine002.hs b/testsuite/tests/lib/IO/hGetLine002.hs deleted file mode 100644 index 5c08b716d1..0000000000 --- a/testsuite/tests/lib/IO/hGetLine002.hs +++ /dev/null @@ -1,16 +0,0 @@ --- !!! testing hGetLine on a file without a final '\n'. - --- According to the Haskell 98 report, getLine should discard a line without a --- closing newline character (see implementation of getLine). --- --- However, we don't believe that this is the right behaviour. - -import System.IO - -main = catch loop (\e -> print e) - -loop = do - hSetBuffering stdin LineBuffering - l <- hGetLine stdin - putStrLn l - loop diff --git a/testsuite/tests/lib/IO/hGetLine002.stdin b/testsuite/tests/lib/IO/hGetLine002.stdin deleted file mode 100644 index 808eafd54b..0000000000 --- a/testsuite/tests/lib/IO/hGetLine002.stdin +++ /dev/null @@ -1 +0,0 @@ -this line doesn't end with a newline
\ No newline at end of file diff --git a/testsuite/tests/lib/IO/hGetLine002.stdout b/testsuite/tests/lib/IO/hGetLine002.stdout deleted file mode 100644 index 0ec29ade8f..0000000000 --- a/testsuite/tests/lib/IO/hGetLine002.stdout +++ /dev/null @@ -1,2 +0,0 @@ -this line doesn't end with a newline -<stdin>: hGetLine: end of file diff --git a/testsuite/tests/lib/IO/hGetLine002.stdout-hugs b/testsuite/tests/lib/IO/hGetLine002.stdout-hugs deleted file mode 100644 index ed871357b7..0000000000 --- a/testsuite/tests/lib/IO/hGetLine002.stdout-hugs +++ /dev/null @@ -1,2 +0,0 @@ -this line doesn't end with a newline -<stdin>: IO.hGetChar: end of file (end of file) diff --git a/testsuite/tests/lib/IO/hGetLine003.hs b/testsuite/tests/lib/IO/hGetLine003.hs deleted file mode 100644 index cc03c604aa..0000000000 --- a/testsuite/tests/lib/IO/hGetLine003.hs +++ /dev/null @@ -1,9 +0,0 @@ -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 - diff --git a/testsuite/tests/lib/IO/hGetLine003.stdin b/testsuite/tests/lib/IO/hGetLine003.stdin deleted file mode 100644 index b8b74a4b1e..0000000000 --- a/testsuite/tests/lib/IO/hGetLine003.stdin +++ /dev/null @@ -1 +0,0 @@ -this line doesn't end with a newline diff --git a/testsuite/tests/lib/IO/hGetLine003.stdout b/testsuite/tests/lib/IO/hGetLine003.stdout deleted file mode 100644 index 6daac48252..0000000000 --- a/testsuite/tests/lib/IO/hGetLine003.stdout +++ /dev/null @@ -1,2 +0,0 @@ -this line doesn't end with a newline -done diff --git a/testsuite/tests/lib/IO/hGetPosn001.hs b/testsuite/tests/lib/IO/hGetPosn001.hs deleted file mode 100644 index 5a0d7d4827..0000000000 --- a/testsuite/tests/lib/IO/hGetPosn001.hs +++ /dev/null @@ -1,28 +0,0 @@ --- !!! Test file positioning - -module Main(main) where - -import Control.Monad -import System.Directory (removeFile, doesFileExist) -import System.IO -import System.IO.Error - -main = do - hIn <- openFile "hGetPosn001.in" ReadMode - f <- doesFileExist "hGetPosn001.out" - when f (removeFile "hGetPosn001.out") - hOut <- openFile "hGetPosn001.out" ReadWriteMode - bof <- hGetPosn hIn - putStrLn (show bof) -- you can show HandlePosns - copy hIn hOut - hSetPosn bof - copy hIn hOut - hSeek hOut AbsoluteSeek 0 - stuff <- hGetContents hOut - putStr stuff - -copy :: Handle -> Handle -> IO () -copy hIn hOut = - try (hGetChar hIn) >>= - either (\ err -> if isEOFError err then return () else error "copy") - ( \ x -> hPutChar hOut x >> copy hIn hOut) diff --git a/testsuite/tests/lib/IO/hGetPosn001.in b/testsuite/tests/lib/IO/hGetPosn001.in deleted file mode 100644 index 2e2537150f..0000000000 --- a/testsuite/tests/lib/IO/hGetPosn001.in +++ /dev/null @@ -1,2 +0,0 @@ -123456789*123456789*123456789*123456789*123456789*123456789*123456789*12 - 1 2 3 4 5 6 7 diff --git a/testsuite/tests/lib/IO/hGetPosn001.stdout b/testsuite/tests/lib/IO/hGetPosn001.stdout deleted file mode 100644 index 10adafd933..0000000000 --- a/testsuite/tests/lib/IO/hGetPosn001.stdout +++ /dev/null @@ -1,5 +0,0 @@ -{handle: hGetPosn001.in} at position 0 -123456789*123456789*123456789*123456789*123456789*123456789*123456789*12 - 1 2 3 4 5 6 7 -123456789*123456789*123456789*123456789*123456789*123456789*123456789*12 - 1 2 3 4 5 6 7 diff --git a/testsuite/tests/lib/IO/hGetPosn001.stdout-hugs b/testsuite/tests/lib/IO/hGetPosn001.stdout-hugs deleted file mode 100644 index 56e989c493..0000000000 --- a/testsuite/tests/lib/IO/hGetPosn001.stdout-hugs +++ /dev/null @@ -1,5 +0,0 @@ -<handle> at position 0 -123456789*123456789*123456789*123456789*123456789*123456789*123456789*12 - 1 2 3 4 5 6 7 -123456789*123456789*123456789*123456789*123456789*123456789*123456789*12 - 1 2 3 4 5 6 7 diff --git a/testsuite/tests/lib/IO/hIsEOF001.hs b/testsuite/tests/lib/IO/hIsEOF001.hs deleted file mode 100644 index 2e5dbdcb0a..0000000000 --- a/testsuite/tests/lib/IO/hIsEOF001.hs +++ /dev/null @@ -1,7 +0,0 @@ --- !!! hIsEOF (on stdout) - -import System.IO ( hIsEOF, stdout ) - -main = do - flg <- hIsEOF stdout `catch` \ _ -> putStrLn "hIsEOF failed" >> return False - print flg diff --git a/testsuite/tests/lib/IO/hIsEOF001.stdout b/testsuite/tests/lib/IO/hIsEOF001.stdout deleted file mode 100644 index 76460ac50a..0000000000 --- a/testsuite/tests/lib/IO/hIsEOF001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -hIsEOF failed -False diff --git a/testsuite/tests/lib/IO/hIsEOF002.hs b/testsuite/tests/lib/IO/hIsEOF002.hs deleted file mode 100644 index 26f5abd9a7..0000000000 --- a/testsuite/tests/lib/IO/hIsEOF002.hs +++ /dev/null @@ -1,48 +0,0 @@ --- !!! test hIsEOF in various buffering situations - -import System.IO - -main = do - h <- openFile "hIsEOF002.hs" ReadMode - hSetBuffering h NoBuffering - hSeek h SeekFromEnd 0 - hIsEOF h >>= print - hSeek h SeekFromEnd (-1) - hIsEOF h >>= print - hGetChar h >>= print - - hSetBuffering h LineBuffering - hSeek h SeekFromEnd 0 - hIsEOF h >>= print - hSeek h SeekFromEnd (-1) - hIsEOF h >>= print - hGetChar h >>= print - - hSetBuffering h (BlockBuffering (Just 1)) - hSeek h SeekFromEnd 0 - hIsEOF h >>= print - hSeek h SeekFromEnd (-1) - hIsEOF h >>= print - hGetChar h >>= print - - hSetBuffering h (BlockBuffering Nothing) - hSeek h SeekFromEnd 0 - hIsEOF h >>= print - hSeek h SeekFromEnd (-1) - hIsEOF h >>= print - hGetChar h >>= print - hClose h - - h <- openFile "hIsEOF002.out" WriteMode - hPutStrLn h "hello, world" - hClose h - - h <- openFile "hIsEOF002.out" ReadWriteMode - hSetBuffering h NoBuffering - hSeek h SeekFromEnd 0 - hIsEOF h >>= print - hPutChar h 'x' - hIsEOF h >>= print - hSeek h SeekFromEnd (-1) - hIsEOF h >>= print - hGetChar h >>= print diff --git a/testsuite/tests/lib/IO/hIsEOF002.stdout b/testsuite/tests/lib/IO/hIsEOF002.stdout deleted file mode 100644 index 3aa5e1a64d..0000000000 --- a/testsuite/tests/lib/IO/hIsEOF002.stdout +++ /dev/null @@ -1,16 +0,0 @@ -True -False -'\n' -True -False -'\n' -True -False -'\n' -True -False -'\n' -True -True -False -'x' diff --git a/testsuite/tests/lib/IO/hReady001.hs b/testsuite/tests/lib/IO/hReady001.hs deleted file mode 100644 index 00888dac2d..0000000000 --- a/testsuite/tests/lib/IO/hReady001.hs +++ /dev/null @@ -1,11 +0,0 @@ --- !!! hReady test - - -- hReady should throw and EOF exception at the end of a file. Trac #1063. - -import System.IO - -main = do - h <- openFile "hReady001.hs" ReadMode - hReady h >>= print - hSeek h SeekFromEnd 0 - (hReady h >> return ()) `catch` print diff --git a/testsuite/tests/lib/IO/hReady001.stdout b/testsuite/tests/lib/IO/hReady001.stdout deleted file mode 100644 index af35f80533..0000000000 --- a/testsuite/tests/lib/IO/hReady001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -True -hReady001.hs: hWaitForInput: end of file diff --git a/testsuite/tests/lib/IO/hReady002.hs b/testsuite/tests/lib/IO/hReady002.hs deleted file mode 100644 index 6db22a13fc..0000000000 --- a/testsuite/tests/lib/IO/hReady002.hs +++ /dev/null @@ -1,10 +0,0 @@ --- test for bug #4078
-import System.IO
-import Control.Concurrent
-import System.Exit
-
-main = do
- m <- newEmptyMVar
- forkIO $ do threadDelay 500000; putMVar m Nothing
- forkIO $ do hReady stdin >>= putMVar m . Just
- takeMVar m >>= print
diff --git a/testsuite/tests/lib/IO/hReady002.stdout b/testsuite/tests/lib/IO/hReady002.stdout deleted file mode 100644 index 6217d00e10..0000000000 --- a/testsuite/tests/lib/IO/hReady002.stdout +++ /dev/null @@ -1 +0,0 @@ -Just False
diff --git a/testsuite/tests/lib/IO/hSeek001.hs b/testsuite/tests/lib/IO/hSeek001.hs deleted file mode 100644 index d05068e955..0000000000 --- a/testsuite/tests/lib/IO/hSeek001.hs +++ /dev/null @@ -1,30 +0,0 @@ -{-# LANGUAGE CPP #-} --- !!! Test seeking - -import System.IO - -main = do - h <- openFile "hSeek001.in" ReadMode - True <- hIsSeekable h - hSeek h SeekFromEnd (-1) - z <- hGetChar h - putStr (z:"\n") - hSeek h SeekFromEnd (-3) - x <- hGetChar h - putStr (x:"\n") - hSeek h RelativeSeek (-2) - w <- hGetChar h - putStr (w:"\n") - hSeek h RelativeSeek 2 - z <- hGetChar h - putStr (z:"\n") - hSeek h AbsoluteSeek (0) - a <- hGetChar h - putStr (a:"\n") - hSeek h AbsoluteSeek (10) - k <- hGetChar h - putStr (k:"\n") - hSeek h AbsoluteSeek (25) - z <- hGetChar h - putStr (z:"\n") - hClose h diff --git a/testsuite/tests/lib/IO/hSeek001.in b/testsuite/tests/lib/IO/hSeek001.in deleted file mode 100644 index e85d5b4528..0000000000 --- a/testsuite/tests/lib/IO/hSeek001.in +++ /dev/null @@ -1 +0,0 @@ -abcdefghijklmnopqrstuvwxyz
\ No newline at end of file diff --git a/testsuite/tests/lib/IO/hSeek001.stdout b/testsuite/tests/lib/IO/hSeek001.stdout deleted file mode 100644 index ab6c1d751b..0000000000 --- a/testsuite/tests/lib/IO/hSeek001.stdout +++ /dev/null @@ -1,7 +0,0 @@ -z -x -w -z -a -k -z diff --git a/testsuite/tests/lib/IO/hSeek002.hs b/testsuite/tests/lib/IO/hSeek002.hs deleted file mode 100644 index 8c9153cfaa..0000000000 --- a/testsuite/tests/lib/IO/hSeek002.hs +++ /dev/null @@ -1,25 +0,0 @@ --- !!! Testing EOF (and the clearing of it) - -module Main(main) where - -import System.IO -import System.Directory ( removeFile ) - -main :: IO () -main = do - hdl <- openFile "hSeek002.hs" ReadMode - flg <- hIsEOF hdl - print flg - hSeek hdl SeekFromEnd 0 - flg <- hIsEOF hdl - print flg - hSeek hdl SeekFromEnd (-1) - flg <- hIsEOF hdl - print flg - hGetChar hdl - flg <- hIsEOF hdl - print flg - hSeek hdl SeekFromEnd (-1) - flg <- hIsEOF hdl - print flg - hClose hdl diff --git a/testsuite/tests/lib/IO/hSeek002.stdout b/testsuite/tests/lib/IO/hSeek002.stdout deleted file mode 100644 index 8069fe32b0..0000000000 --- a/testsuite/tests/lib/IO/hSeek002.stdout +++ /dev/null @@ -1,5 +0,0 @@ -False -True -False -True -False diff --git a/testsuite/tests/lib/IO/hSeek003.hs b/testsuite/tests/lib/IO/hSeek003.hs deleted file mode 100644 index 03400573c4..0000000000 --- a/testsuite/tests/lib/IO/hSeek003.hs +++ /dev/null @@ -1,51 +0,0 @@ --- !!! file positions (hGetPosn and hSetPosn) - -module Main(main) where - -import System.IO -import Control.Monad ( sequence ) - -testPosns :: Handle -> BufferMode -> IO () -testPosns hdl bmo = do - hSetBuffering hdl bmo - putStrLn ("Testing positioning with buffer mode set to: " ++ show bmo) - testPositioning hdl - -bmo_ls = [NoBuffering, LineBuffering, BlockBuffering Nothing, - BlockBuffering (Just 511),BlockBuffering (Just 3), BlockBuffering (Just 11)] - -main = do - hdl <- openFile "hSeek003.hs" ReadMode - sequence (zipWith testPosns (repeat hdl) bmo_ls) - hClose hdl - -testPositioning hdl = do - hSeek hdl AbsoluteSeek 0 -- go to the beginning of the file again. - ps <- getFilePosns 10 hdl - hSeek hdl AbsoluteSeek 0 - putStr "First ten chars: " - ls <- hGetChars 10 hdl - putStrLn ls - -- go to the end - hSeek hdl SeekFromEnd 0 - ls <- sequence (map (\ p -> hSetPosn p >> hGetChar hdl) ps) - putStr "First ten chars: " - putStrLn ls - - -- position ourselves in the middle. - sz <- hFileSize hdl - hSeek hdl AbsoluteSeek (sz `div` 2) - ls <- sequence (map (\ p -> hSetPosn p >> hGetChar hdl) ps) - putStr "First ten chars: " - putStrLn ls - -hGetChars :: Int -> Handle -> IO String -hGetChars n h = sequence (replicate n (hGetChar h)) - -getFilePosns :: Int -> Handle -> IO [HandlePosn] -getFilePosns 0 h = return [] -getFilePosns x h = do - p <- hGetPosn h - hGetChar h - ps <- getFilePosns (x-1) h - return (p:ps) diff --git a/testsuite/tests/lib/IO/hSeek003.stdout b/testsuite/tests/lib/IO/hSeek003.stdout deleted file mode 100644 index 7c765c5bc5..0000000000 --- a/testsuite/tests/lib/IO/hSeek003.stdout +++ /dev/null @@ -1,24 +0,0 @@ -Testing positioning with buffer mode set to: NoBuffering -First ten chars: -- !!! fil -First ten chars: -- !!! fil -First ten chars: -- !!! fil -Testing positioning with buffer mode set to: LineBuffering -First ten chars: -- !!! fil -First ten chars: -- !!! fil -First ten chars: -- !!! fil -Testing positioning with buffer mode set to: BlockBuffering Nothing -First ten chars: -- !!! fil -First ten chars: -- !!! fil -First ten chars: -- !!! fil -Testing positioning with buffer mode set to: BlockBuffering (Just 511) -First ten chars: -- !!! fil -First ten chars: -- !!! fil -First ten chars: -- !!! fil -Testing positioning with buffer mode set to: BlockBuffering (Just 3) -First ten chars: -- !!! fil -First ten chars: -- !!! fil -First ten chars: -- !!! fil -Testing positioning with buffer mode set to: BlockBuffering (Just 11) -First ten chars: -- !!! fil -First ten chars: -- !!! fil -First ten chars: -- !!! fil diff --git a/testsuite/tests/lib/IO/hSeek004.hs b/testsuite/tests/lib/IO/hSeek004.hs deleted file mode 100644 index 9ad7c13e7f..0000000000 --- a/testsuite/tests/lib/IO/hSeek004.hs +++ /dev/null @@ -1,8 +0,0 @@ --- !!! can't seek an AppendMode handle - -import System.IO -import System.IO.Error - -main = do - h <- openFile "hSeek004.out" AppendMode - try (hSeek h AbsoluteSeek 0) >>= print diff --git a/testsuite/tests/lib/IO/hSeek004.stdout b/testsuite/tests/lib/IO/hSeek004.stdout deleted file mode 100644 index d2671a6361..0000000000 --- a/testsuite/tests/lib/IO/hSeek004.stdout +++ /dev/null @@ -1 +0,0 @@ -Left hSeek004.out: hSeek: illegal operation (handle is not seekable) diff --git a/testsuite/tests/lib/IO/hSeek004.stdout-mingw b/testsuite/tests/lib/IO/hSeek004.stdout-mingw deleted file mode 100644 index 7d8e7076ee..0000000000 --- a/testsuite/tests/lib/IO/hSeek004.stdout-mingw +++ /dev/null @@ -1,5 +0,0 @@ -Left illegal operation -Action: hSeek -Handle: {loc=hSeek004.out,type=writable (append),binary=True,buffering=block (512)} -Reason: handle is not seekable -File: hSeek004.out diff --git a/testsuite/tests/lib/IO/hSetBuffering002.hs b/testsuite/tests/lib/IO/hSetBuffering002.hs deleted file mode 100644 index 3f553029da..0000000000 --- a/testsuite/tests/lib/IO/hSetBuffering002.hs +++ /dev/null @@ -1,6 +0,0 @@ -import System.IO - -main = - hSetBuffering stdin NoBuffering >> - hSetBuffering stdout NoBuffering >> - interact id diff --git a/testsuite/tests/lib/IO/hSetBuffering002.stdout b/testsuite/tests/lib/IO/hSetBuffering002.stdout deleted file mode 100644 index 3f553029da..0000000000 --- a/testsuite/tests/lib/IO/hSetBuffering002.stdout +++ /dev/null @@ -1,6 +0,0 @@ -import System.IO - -main = - hSetBuffering stdin NoBuffering >> - hSetBuffering stdout NoBuffering >> - interact id diff --git a/testsuite/tests/lib/IO/hSetBuffering003.hs b/testsuite/tests/lib/IO/hSetBuffering003.hs deleted file mode 100644 index 74d399e4ff..0000000000 --- a/testsuite/tests/lib/IO/hSetBuffering003.hs +++ /dev/null @@ -1,79 +0,0 @@ --- !!! Reconfiguring the buffering of a handle -module Main(main) where - -import System.IO - -queryBuffering :: String -> Handle -> IO () -queryBuffering handle_nm handle = do - bufm <- hGetBuffering handle - putStrLn ("Buffering for " ++ handle_nm ++ " is: " ++ show bufm) - -main = do - queryBuffering "stdin" stdin - queryBuffering "stdout" stdout - queryBuffering "stderr" stderr - - -- twiddling the setting for stdin. - hSetBuffering stdin NoBuffering - queryBuffering "stdin" stdin - hSetBuffering stdin LineBuffering - queryBuffering "stdin" stdin - hSetBuffering stdin (BlockBuffering (Just 2)) - queryBuffering "stdin" stdin - hSetBuffering stdin (BlockBuffering Nothing) - queryBuffering "stdin" stdin - let bmo = BlockBuffering (Just (-3)) - hSetBuffering stdin bmo `catch` \ _ -> putStrLn ("Caught illegal op: hSetBuffering stdin " ++ showParen True (showsPrec 9 bmo) []) - - putChar '\n' - - -- twiddling the buffering for stdout - hPutStr stdout "Hello stdout 1" - hSetBuffering stdout NoBuffering - queryBuffering "stdout" stdout - hPutStr stdout "Hello stdout 2" - hSetBuffering stdout LineBuffering - queryBuffering "stdout" stdout - hPutStr stdout "Hello stdout 3" - hSetBuffering stdout (BlockBuffering (Just 2)) - queryBuffering "stdout" stdout - hPutStr stdout "Hello stdout 4" - hSetBuffering stdout (BlockBuffering Nothing) - queryBuffering "stdout" stdout - hPutStr stdout "Hello stdout 5" - let bmo = BlockBuffering (Just (-3)) - hSetBuffering stdout bmo `catch` \ _ -> putStrLn ("Caught illegal op: hSetBuffering stdout " ++ showParen True (showsPrec 9 bmo) []) - - putChar '\n' - - -- twiddling the buffering for stderr - hPutStr stderr "Hello stderr 1" - hSetBuffering stderr NoBuffering - queryBuffering "stderr" stderr - hPutStr stderr "Hello stderr 2" - hSetBuffering stderr LineBuffering - queryBuffering "stderr" stderr - hPutStr stderr "Hello stderr 3" - hSetBuffering stderr (BlockBuffering (Just 2)) - queryBuffering "stderr" stderr - hPutStr stderr "Hello stderr 4" - hSetBuffering stderr (BlockBuffering Nothing) - queryBuffering "stderr" stderr - hPutStr stderr "Hello stderr 5" - let bmo = BlockBuffering (Just (-3)) - hSetBuffering stderr bmo `catch` \ _ -> putStrLn ("Caught illegal op: hSetBuffering stderr " ++ showParen True (showsPrec 9 bmo) []) - - ls <- hGetContents stdin - ls' <- putLine ls - hSetBuffering stdin NoBuffering - putLine ls' - return () - -putLine :: String -> IO String -putLine [] = return [] -putLine (x:xs) = do - putChar x - case x of - '\n' -> return xs - _ -> putLine xs - diff --git a/testsuite/tests/lib/IO/hSetBuffering003.stderr b/testsuite/tests/lib/IO/hSetBuffering003.stderr deleted file mode 100644 index a4cf8779b4..0000000000 --- a/testsuite/tests/lib/IO/hSetBuffering003.stderr +++ /dev/null @@ -1 +0,0 @@ -Hello stderr 1Hello stderr 2Hello stderr 3Hello stderr 4Hello stderr 5
\ No newline at end of file diff --git a/testsuite/tests/lib/IO/hSetBuffering003.stdout b/testsuite/tests/lib/IO/hSetBuffering003.stdout deleted file mode 100644 index 7768773198..0000000000 --- a/testsuite/tests/lib/IO/hSetBuffering003.stdout +++ /dev/null @@ -1,22 +0,0 @@ -Buffering for stdin is: BlockBuffering Nothing -Buffering for stdout is: BlockBuffering Nothing -Buffering for stderr is: NoBuffering -Buffering for stdin is: NoBuffering -Buffering for stdin is: LineBuffering -Buffering for stdin is: BlockBuffering (Just 2) -Buffering for stdin is: BlockBuffering Nothing -Caught illegal op: hSetBuffering stdin (BlockBuffering (Just (-3))) - -Hello stdout 1Buffering for stdout is: NoBuffering -Hello stdout 2Buffering for stdout is: LineBuffering -Hello stdout 3Buffering for stdout is: BlockBuffering (Just 2) -Hello stdout 4Buffering for stdout is: BlockBuffering Nothing -Hello stdout 5Caught illegal op: hSetBuffering stdout (BlockBuffering (Just (-3))) - -Buffering for stderr is: NoBuffering -Buffering for stderr is: LineBuffering -Buffering for stderr is: BlockBuffering (Just 2) -Buffering for stderr is: BlockBuffering Nothing -Caught illegal op: hSetBuffering stderr (BlockBuffering (Just (-3))) --- !!! Reconfiguring the buffering of a handle -module Main(main) where diff --git a/testsuite/tests/lib/IO/hSetBuffering004.hs b/testsuite/tests/lib/IO/hSetBuffering004.hs deleted file mode 100644 index eaee6826d2..0000000000 --- a/testsuite/tests/lib/IO/hSetBuffering004.hs +++ /dev/null @@ -1,9 +0,0 @@ --- test for #2678 -module Main (main) where - -import System.IO - -main :: IO () -main = do hSetBuffering stdin NoBuffering - hLookAhead stdin >>= print - hSetBuffering stdin LineBuffering diff --git a/testsuite/tests/lib/IO/hSetBuffering004.stdout b/testsuite/tests/lib/IO/hSetBuffering004.stdout deleted file mode 100644 index 7766eec971..0000000000 --- a/testsuite/tests/lib/IO/hSetBuffering004.stdout +++ /dev/null @@ -1 +0,0 @@ -'-' diff --git a/testsuite/tests/lib/IO/hSetEncoding001.hs b/testsuite/tests/lib/IO/hSetEncoding001.hs deleted file mode 100644 index 95f570d094..0000000000 --- a/testsuite/tests/lib/IO/hSetEncoding001.hs +++ /dev/null @@ -1,49 +0,0 @@ -import System.IO -import GHC.IO.Handle -import GHC.IO.Encoding -import System.Environment - --- Test switching encodings --- The test file is built by the Makefile - -main = do - [file] <- getArgs - test file NoBuffering - test file (BlockBuffering Nothing) - test file (BlockBuffering (Just 5)) - -test file buf = do - hSetEncoding stdout utf8 - h <- openBinaryFile file ReadMode - hSetBuffering stdout buf - putStrLn "no encoding:" - getUntilX h - hSetEncoding h utf8 - putStrLn "UTF8:" - getUntilX h - hSetEncoding h utf16le - putStrLn "UTF16LE:" - getUntilX h - hSetEncoding h utf16be - putStrLn "UTF16BE:" - getUntilX h - hSetEncoding h utf16 - putStrLn "UTF16:" - getUntilX h - hSetEncoding h utf32 - putStrLn "UTF32:" - getUntilX h - hSetEncoding h utf32le - putStrLn "UTF32LE:" - getUntilX h - hSetEncoding h utf32be - putStrLn "UTF32BE:" - getUntilX h - hSetEncoding h utf8_bom - putStrLn "UTF8-BOM:" - getUntilX h - hIsEOF h >>= print - -getUntilX h = do - c <- hGetChar h - if c == 'X' then return () else do putChar c; getUntilX h diff --git a/testsuite/tests/lib/IO/hSetEncoding001.in b/testsuite/tests/lib/IO/hSetEncoding001.in Binary files differdeleted file mode 100644 index 03f297441d..0000000000 --- a/testsuite/tests/lib/IO/hSetEncoding001.in +++ /dev/null diff --git a/testsuite/tests/lib/IO/hSetEncoding001.stdout b/testsuite/tests/lib/IO/hSetEncoding001.stdout deleted file mode 100644 index a1d38ffd77..0000000000 --- a/testsuite/tests/lib/IO/hSetEncoding001.stdout +++ /dev/null @@ -1,90 +0,0 @@ -no encoding: -c0 | À à Â Ã Ä Ã… Æ Ç È É Ê Ë ÃŒ à Î à -d0 | à Ñ Ã’ Ó Ô Õ Ö × Ø Ù Ú Û Ãœ à Þ ß -e0 | à á â ã ä Ã¥ æ ç è é ê ë ì à î ï -f0 | ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ -UTF8: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16LE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16BE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32LE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32BE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF8-BOM: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -True -no encoding: -c0 | À à Â Ã Ä Ã… Æ Ç È É Ê Ë ÃŒ à Î à -d0 | à Ñ Ã’ Ó Ô Õ Ö × Ø Ù Ú Û Ãœ à Þ ß -e0 | à á â ã ä Ã¥ æ ç è é ê ë ì à î ï -f0 | ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ -UTF8: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16LE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16BE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32LE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32BE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF8-BOM: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -True -no encoding: -c0 | À à Â Ã Ä Ã… Æ Ç È É Ê Ë ÃŒ à Î à -d0 | à Ñ Ã’ Ó Ô Õ Ö × Ø Ù Ú Û Ãœ à Þ ß -e0 | à á â ã ä Ã¥ æ ç è é ê ë ì à î ï -f0 | ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ -UTF8: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16LE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16BE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF16: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32LE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF32BE: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -UTF8-BOM: -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -True diff --git a/testsuite/tests/lib/IO/hSetEncoding002.hs b/testsuite/tests/lib/IO/hSetEncoding002.hs deleted file mode 100644 index 35c4e1ce19..0000000000 --- a/testsuite/tests/lib/IO/hSetEncoding002.hs +++ /dev/null @@ -1,13 +0,0 @@ --- test for #4066 - -import System.IO - -import GHC.IO.FD as FD (stdout) -import GHC.IO.Handle.FD as FD (fdToHandle) -import GHC.IO.Handle ( mkDuplexHandle ) - -main = do - h <- mkDuplexHandle FD.stdout "stdout" Nothing noNewlineTranslation - hSetEncoding h utf8 - hPutStrLn h "ö" - hClose h diff --git a/testsuite/tests/lib/IO/hSetEncoding002.stdout b/testsuite/tests/lib/IO/hSetEncoding002.stdout deleted file mode 100644 index d3b4b915a1..0000000000 --- a/testsuite/tests/lib/IO/hSetEncoding002.stdout +++ /dev/null @@ -1 +0,0 @@ -ö diff --git a/testsuite/tests/lib/IO/ioeGetErrorString001.hs b/testsuite/tests/lib/IO/ioeGetErrorString001.hs deleted file mode 100644 index 5621136a55..0000000000 --- a/testsuite/tests/lib/IO/ioeGetErrorString001.hs +++ /dev/null @@ -1,13 +0,0 @@ --- !!! test ioeGetErrorString - -import System.IO -import System.IO.Error -import Data.Maybe - -main = do - h <- openFile "ioeGetErrorString001.hs" ReadMode - hSeek h SeekFromEnd 0 - (hGetChar h >> return ()) `catch` - \e -> if isEOFError e - then print (ioeGetErrorString e) - else putStrLn "failed." diff --git a/testsuite/tests/lib/IO/ioeGetErrorString001.stdout b/testsuite/tests/lib/IO/ioeGetErrorString001.stdout deleted file mode 100644 index 0b8daea55a..0000000000 --- a/testsuite/tests/lib/IO/ioeGetErrorString001.stdout +++ /dev/null @@ -1 +0,0 @@ -"end of file" diff --git a/testsuite/tests/lib/IO/ioeGetFileName001.hs b/testsuite/tests/lib/IO/ioeGetFileName001.hs deleted file mode 100644 index 12c70c98b4..0000000000 --- a/testsuite/tests/lib/IO/ioeGetFileName001.hs +++ /dev/null @@ -1,12 +0,0 @@ --- !!! test ioeGetFileName - -import System.IO -import System.IO.Error - -main = do - h <- openFile "ioeGetFileName001.hs" ReadMode - hSeek h SeekFromEnd 0 - (hGetChar h >> return ()) `catch` - \e -> if isEOFError e - then print (ioeGetFileName e) - else putStrLn "failed." diff --git a/testsuite/tests/lib/IO/ioeGetFileName001.stdout b/testsuite/tests/lib/IO/ioeGetFileName001.stdout deleted file mode 100644 index 7377ad409d..0000000000 --- a/testsuite/tests/lib/IO/ioeGetFileName001.stdout +++ /dev/null @@ -1 +0,0 @@ -Just "ioeGetFileName001.hs" diff --git a/testsuite/tests/lib/IO/ioeGetHandle001.hs b/testsuite/tests/lib/IO/ioeGetHandle001.hs deleted file mode 100644 index a9ef58a8ca..0000000000 --- a/testsuite/tests/lib/IO/ioeGetHandle001.hs +++ /dev/null @@ -1,13 +0,0 @@ --- !!! test ioeGetHandle - -import System.IO -import System.IO.Error -import Data.Maybe - -main = do - h <- openFile "ioeGetHandle001.hs" ReadMode - hSeek h SeekFromEnd 0 - (hGetChar h >> return ()) `catch` - \e -> if isEOFError e && fromJust (ioeGetHandle e) == h - then putStrLn "ok." - else putStrLn "failed." diff --git a/testsuite/tests/lib/IO/ioeGetHandle001.stdout b/testsuite/tests/lib/IO/ioeGetHandle001.stdout deleted file mode 100644 index 90b5016eff..0000000000 --- a/testsuite/tests/lib/IO/ioeGetHandle001.stdout +++ /dev/null @@ -1 +0,0 @@ -ok. diff --git a/testsuite/tests/lib/IO/isEOF001.hs b/testsuite/tests/lib/IO/isEOF001.hs deleted file mode 100644 index bb205703f8..0000000000 --- a/testsuite/tests/lib/IO/isEOF001.hs +++ /dev/null @@ -1,3 +0,0 @@ -import System.IO - -main = isEOF >>= print diff --git a/testsuite/tests/lib/IO/isEOF001.stdout b/testsuite/tests/lib/IO/isEOF001.stdout deleted file mode 100644 index 0ca95142bb..0000000000 --- a/testsuite/tests/lib/IO/isEOF001.stdout +++ /dev/null @@ -1 +0,0 @@ -True diff --git a/testsuite/tests/lib/IO/latin1 b/testsuite/tests/lib/IO/latin1 deleted file mode 100644 index a634257fbf..0000000000 --- a/testsuite/tests/lib/IO/latin1 +++ /dev/null @@ -1,5 +0,0 @@ -c0 | À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï -d0 | Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß -e0 | à á â ã ä å æ ç è é ê ë ì í î ï -f0 | ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ -X
\ No newline at end of file diff --git a/testsuite/tests/lib/IO/misc001.hs b/testsuite/tests/lib/IO/misc001.hs deleted file mode 100644 index 9f9f3e98d0..0000000000 --- a/testsuite/tests/lib/IO/misc001.hs +++ /dev/null @@ -1,24 +0,0 @@ -import System.IO - -import Data.Char (toUpper) -import System.Directory (removeFile, doesFileExist) -import System.Environment (getArgs) - -main = do - [f1,f2] <- getArgs - h1 <- openFile f1 ReadMode - f <- doesFileExist f2 - if f then removeFile f2 else return () - h2 <- openFile f2 WriteMode - copyFile h1 h2 - hClose h1 - hClose h2 - -copyFile h1 h2 = do - eof <- hIsEOF h1 - if eof - then return () - else do - c <- hGetChar h1 - c <- hPutChar h2 (toUpper c) - copyFile h1 h2 diff --git a/testsuite/tests/lib/IO/misc001.stdout b/testsuite/tests/lib/IO/misc001.stdout deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/lib/IO/misc001.stdout +++ /dev/null diff --git a/testsuite/tests/lib/IO/newline001.hs b/testsuite/tests/lib/IO/newline001.hs deleted file mode 100644 index b12a65bcaa..0000000000 --- a/testsuite/tests/lib/IO/newline001.hs +++ /dev/null @@ -1,121 +0,0 @@ -import System.IO -import GHC.IO.Handle -import Control.Monad -import Data.List - -newlines = ["\n","\r","\r\n","\n\r","\n\n","\r\r"] - --- make sure the file ends in '\r': that's a tricky case for CRLF --- conversion, because the IO library has to check whether there's a --- following \n before returning the \r. -content = concat [ show i ++ t | (i,t) <- zip [1..100] (cycle newlines) ] - -filename = "newline001.out" - -fromCRLF [] = [] -fromCRLF ('\r':'\n':cs) = '\n' : fromCRLF cs -fromCRLF (c:cs) = c : fromCRLF cs - -toCRLF [] = [] -toCRLF ('\n':cs) = '\r':'\n': toCRLF cs -toCRLF (c:cs) = c : toCRLF cs - -main = do - h <- openBinaryFile filename WriteMode - hPutStr h content - hClose h - testinput NoBuffering - testinput LineBuffering - testinput (BlockBuffering Nothing) - testinput (BlockBuffering (Just 3)) - testinput (BlockBuffering (Just 7)) - testinput (BlockBuffering (Just 16)) - testoutput NoBuffering - testoutput LineBuffering - testoutput (BlockBuffering Nothing) - testoutput (BlockBuffering (Just 3)) - testoutput (BlockBuffering (Just 7)) - testoutput (BlockBuffering (Just 16)) - -testinput b = do - h <- openFile filename ReadMode - hSetBuffering h b - hSetNewlineMode h noNewlineTranslation - str <- hGetContents h - check "in1" b str content - hClose h - - h <- openFile filename ReadMode - hSetBuffering h b - hSetNewlineMode h noNewlineTranslation - str <- read_chars h - check "in2" b str content - hClose h - - h <- openFile filename ReadMode - hSetBuffering h b - hSetNewlineMode h noNewlineTranslation - str <- read_lines h - check "in3" b str content - hClose h - - h <- openFile filename ReadMode - hSetBuffering h b - hSetNewlineMode h NewlineMode{ inputNL=CRLF, outputNL=LF } - str <- hGetContents h - check "in4" b str (fromCRLF content) - hClose h - - h <- openFile filename ReadMode - hSetBuffering h b - hSetNewlineMode h NewlineMode{ inputNL=CRLF, outputNL=LF } - str <- read_chars h - check "in5" b str (fromCRLF content) - hClose h - - h <- openFile filename ReadMode - hSetBuffering h b - hSetNewlineMode h NewlineMode{ inputNL=CRLF, outputNL=LF } - str <- read_lines h - check "in6" b str (fromCRLF content) - hClose h - -testoutput b = do - h <- openFile filename WriteMode - hSetBuffering h b - hSetNewlineMode h NewlineMode{ inputNL=LF, outputNL=CRLF } - hPutStr h content - hClose h - h <- openBinaryFile filename ReadMode - str <- hGetContents h - check "out1" b (toCRLF content) str - hClose h - - h <- openFile filename WriteMode - hSetBuffering h b - hSetNewlineMode h NewlineMode{ inputNL=LF, outputNL=CRLF } - mapM_ (hPutChar h) content - hClose h - h <- openBinaryFile filename ReadMode - str <- hGetContents h - check "out2" b (toCRLF content) str - hClose h - -check s b str1 str2 = do - when (str1 /= str2) $ error ("failed: " ++ s ++ ", " ++ show b ++ '\n':show str1 ++ '\n':show str2) - -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) - -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) diff --git a/testsuite/tests/lib/IO/openFile001.hs b/testsuite/tests/lib/IO/openFile001.hs deleted file mode 100644 index f34f093d38..0000000000 --- a/testsuite/tests/lib/IO/openFile001.hs +++ /dev/null @@ -1,11 +0,0 @@ --- !!! test that a file opened in ReadMode can't be written to - -import System.IO -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" diff --git a/testsuite/tests/lib/IO/openFile001.stdout b/testsuite/tests/lib/IO/openFile001.stdout deleted file mode 100644 index 90b5016eff..0000000000 --- a/testsuite/tests/lib/IO/openFile001.stdout +++ /dev/null @@ -1 +0,0 @@ -ok. diff --git a/testsuite/tests/lib/IO/openFile002.hs b/testsuite/tests/lib/IO/openFile002.hs deleted file mode 100644 index 83822621f6..0000000000 --- a/testsuite/tests/lib/IO/openFile002.hs +++ /dev/null @@ -1,6 +0,0 @@ -import Data.Char -import System.IO - --- !!! Open a non-existent file for reading (should fail) - -main = openFile "nonexistent" ReadMode diff --git a/testsuite/tests/lib/IO/openFile002.stderr b/testsuite/tests/lib/IO/openFile002.stderr deleted file mode 100644 index b011f34146..0000000000 --- a/testsuite/tests/lib/IO/openFile002.stderr +++ /dev/null @@ -1 +0,0 @@ -openFile002: nonexistent: openFile: does not exist (No such file or directory) diff --git a/testsuite/tests/lib/IO/openFile002.stderr-hugs b/testsuite/tests/lib/IO/openFile002.stderr-hugs deleted file mode 100644 index aa76710e44..0000000000 --- a/testsuite/tests/lib/IO/openFile002.stderr-hugs +++ /dev/null @@ -1 +0,0 @@ -openFile002: nonexistent: IO.openFile: does not exist (file does not exist) diff --git a/testsuite/tests/lib/IO/openFile003.hs b/testsuite/tests/lib/IO/openFile003.hs deleted file mode 100644 index f3c640f295..0000000000 --- a/testsuite/tests/lib/IO/openFile003.hs +++ /dev/null @@ -1,17 +0,0 @@ -import System.Directory -import System.IO -import System.IO.Error - --- !!! Open a directory (should fail) - -main = do - let dir = "openFile003Dir" - createDirectoryIfMissing False dir - r <- tryIOError (openFile dir ReadMode) - print r - r <- tryIOError (openFile dir WriteMode) - print r - r <- tryIOError (openFile dir AppendMode) - print r - r <- tryIOError (openFile dir ReadWriteMode) - print r diff --git a/testsuite/tests/lib/IO/openFile003.stdout b/testsuite/tests/lib/IO/openFile003.stdout deleted file mode 100644 index 3621518cdb..0000000000 --- a/testsuite/tests/lib/IO/openFile003.stdout +++ /dev/null @@ -1,4 +0,0 @@ -Left openFile003Dir: openFile: inappropriate type (is a directory) -Left openFile003Dir: openFile: inappropriate type (Is a directory) -Left openFile003Dir: openFile: inappropriate type (Is a directory) -Left openFile003Dir: openFile: inappropriate type (Is a directory) diff --git a/testsuite/tests/lib/IO/openFile003.stdout-i386-unknown-mingw32 b/testsuite/tests/lib/IO/openFile003.stdout-i386-unknown-mingw32 deleted file mode 100644 index bf99bcf80d..0000000000 --- a/testsuite/tests/lib/IO/openFile003.stdout-i386-unknown-mingw32 +++ /dev/null @@ -1,4 +0,0 @@ -Left openFile003Dir: openFile: permission denied (Permission denied)
-Left openFile003Dir: openFile: permission denied (Permission denied)
-Left openFile003Dir: openFile: permission denied (Permission denied)
-Left openFile003Dir: openFile: permission denied (Permission denied)
diff --git a/testsuite/tests/lib/IO/openFile003.stdout-i386-unknown-solaris2 b/testsuite/tests/lib/IO/openFile003.stdout-i386-unknown-solaris2 deleted file mode 100644 index 6a78a2a891..0000000000 --- a/testsuite/tests/lib/IO/openFile003.stdout-i386-unknown-solaris2 +++ /dev/null @@ -1,4 +0,0 @@ -Left openFile003Dir: openFile: inappropriate type (is a directory) -Left openFile003Dir: openFile: invalid argument (Invalid argument) -Left openFile003Dir: openFile: invalid argument (Invalid argument) -Left openFile003Dir: openFile: invalid argument (Invalid argument) diff --git a/testsuite/tests/lib/IO/openFile003.stdout-mingw b/testsuite/tests/lib/IO/openFile003.stdout-mingw deleted file mode 100644 index 2f63d8ce18..0000000000 --- a/testsuite/tests/lib/IO/openFile003.stdout-mingw +++ /dev/null @@ -1,16 +0,0 @@ -Left permission denied -Action: openFile -Reason: Permission denied -File: openFile003Dir -Left permission denied -Action: openFile -Reason: Permission denied -File: openFile003Dir -Left permission denied -Action: openFile -Reason: Permission denied -File: openFile003Dir -Left permission denied -Action: openFile -Reason: Permission denied -File: openFile003Dir diff --git a/testsuite/tests/lib/IO/openFile003.stdout-mips-sgi-irix b/testsuite/tests/lib/IO/openFile003.stdout-mips-sgi-irix deleted file mode 100644 index 6a78a2a891..0000000000 --- a/testsuite/tests/lib/IO/openFile003.stdout-mips-sgi-irix +++ /dev/null @@ -1,4 +0,0 @@ -Left openFile003Dir: openFile: inappropriate type (is a directory) -Left openFile003Dir: openFile: invalid argument (Invalid argument) -Left openFile003Dir: openFile: invalid argument (Invalid argument) -Left openFile003Dir: openFile: invalid argument (Invalid argument) diff --git a/testsuite/tests/lib/IO/openFile003.stdout-sparc-sun-solaris2 b/testsuite/tests/lib/IO/openFile003.stdout-sparc-sun-solaris2 deleted file mode 100644 index 6a78a2a891..0000000000 --- a/testsuite/tests/lib/IO/openFile003.stdout-sparc-sun-solaris2 +++ /dev/null @@ -1,4 +0,0 @@ -Left openFile003Dir: openFile: inappropriate type (is a directory) -Left openFile003Dir: openFile: invalid argument (Invalid argument) -Left openFile003Dir: openFile: invalid argument (Invalid argument) -Left openFile003Dir: openFile: invalid argument (Invalid argument) diff --git a/testsuite/tests/lib/IO/openFile004.hs b/testsuite/tests/lib/IO/openFile004.hs deleted file mode 100644 index 4124abb0de..0000000000 --- a/testsuite/tests/lib/IO/openFile004.hs +++ /dev/null @@ -1,23 +0,0 @@ --- !!! Open a non-existent file for writing - -import Control.Monad -import Data.Char -import System.Directory -import System.IO - -file = "openFile004.out" - -main = do - b <- doesFileExist file - when b (removeFile file) - - h <- openFile file WriteMode - hPutStr h "hello world\n" - hClose h - - h <- openFile file ReadMode - let loop = do - b <- hIsEOF h - if b then return () - else do c <- hGetChar h; putChar c; loop - loop diff --git a/testsuite/tests/lib/IO/openFile004.stdout b/testsuite/tests/lib/IO/openFile004.stdout deleted file mode 100644 index 3b18e512db..0000000000 --- a/testsuite/tests/lib/IO/openFile004.stdout +++ /dev/null @@ -1 +0,0 @@ -hello world diff --git a/testsuite/tests/lib/IO/openFile005.hs b/testsuite/tests/lib/IO/openFile005.hs deleted file mode 100644 index d8a8f83453..0000000000 --- a/testsuite/tests/lib/IO/openFile005.hs +++ /dev/null @@ -1,45 +0,0 @@ --- !!! test multiple-reader single-writer locking semantics - -import System.IO -import System.IO.Error - -file1 = "openFile005.out1" -file2 = "openFile005.out2" - -main = do - putStrLn "two writes (should fail)" - h <- openFile file1 WriteMode - tryIOError (openFile file1 WriteMode) >>= print - hClose h - - putStrLn "write and an append (should fail)" - h <- openFile file1 WriteMode - tryIOError (openFile file1 AppendMode) >>= print - hClose h - - putStrLn "read/write and a write (should fail)" - h <- openFile file1 ReadWriteMode - tryIOError (openFile file1 WriteMode) >>= print - hClose h - - putStrLn "read and a read/write (should fail)" - h <- openFile file1 ReadMode - tryIOError (openFile file1 ReadWriteMode) >>= print - hClose h - - putStrLn "write and a read (should fail)" - h <- openFile file1 WriteMode - tryIOError (openFile file1 ReadMode) >>= print - hClose h - - putStrLn "two writes, different files (silly, but should succeed)" - h1 <- openFile file1 WriteMode - h2 <- openFile file2 WriteMode - hClose h1 - hClose h2 - - putStrLn "two reads, should succeed" - h1 <- openFile file1 ReadMode - h2 <- openFile file1 ReadMode - hClose h1 - hClose h2 diff --git a/testsuite/tests/lib/IO/openFile005.stdout b/testsuite/tests/lib/IO/openFile005.stdout deleted file mode 100644 index 1a4b843be0..0000000000 --- a/testsuite/tests/lib/IO/openFile005.stdout +++ /dev/null @@ -1,12 +0,0 @@ -two writes (should fail) -Left openFile005.out1: openFile: resource busy (file is locked) -write and an append (should fail) -Left openFile005.out1: openFile: resource busy (file is locked) -read/write and a write (should fail) -Left openFile005.out1: openFile: resource busy (file is locked) -read and a read/write (should fail) -Left openFile005.out1: openFile: resource busy (file is locked) -write and a read (should fail) -Left openFile005.out1: openFile: resource busy (file is locked) -two writes, different files (silly, but should succeed) -two reads, should succeed diff --git a/testsuite/tests/lib/IO/openFile005.stdout-i386-unknown-mingw32 b/testsuite/tests/lib/IO/openFile005.stdout-i386-unknown-mingw32 deleted file mode 100644 index bf227989a9..0000000000 --- a/testsuite/tests/lib/IO/openFile005.stdout-i386-unknown-mingw32 +++ /dev/null @@ -1,12 +0,0 @@ -two writes (should fail) -Left openFile005.out1: openFile: permission denied (Permission denied) -write and an append (should fail) -Left openFile005.out1: openFile: permission denied (Permission denied) -read/write and a write (should fail) -Left openFile005.out1: openFile: permission denied (Permission denied) -read and a read/write (should fail) -Left openFile005.out1: openFile: permission denied (Permission denied) -write and a read (should fail) -Left openFile005.out1: openFile: permission denied (Permission denied) -two writes, different files (silly, but should succeed) -two reads, should succeed diff --git a/testsuite/tests/lib/IO/openFile006.hs b/testsuite/tests/lib/IO/openFile006.hs deleted file mode 100644 index 63cfea1a87..0000000000 --- a/testsuite/tests/lib/IO/openFile006.hs +++ /dev/null @@ -1,14 +0,0 @@ --- !!! opening a file in WriteMode better truncate it - -import System.IO - -main = do - h <- openFile "openFile006.out" AppendMode - hPutStr h "hello, world" - size <- hFileSize h - print size - hClose h - - h <- openFile "openFile006.out" WriteMode - size <- hFileSize h - print size diff --git a/testsuite/tests/lib/IO/openFile006.stdout b/testsuite/tests/lib/IO/openFile006.stdout deleted file mode 100644 index 368283eb3d..0000000000 --- a/testsuite/tests/lib/IO/openFile006.stdout +++ /dev/null @@ -1,2 +0,0 @@ -12 -0 diff --git a/testsuite/tests/lib/IO/openFile007.hs b/testsuite/tests/lib/IO/openFile007.hs deleted file mode 100644 index e39ed6538f..0000000000 --- a/testsuite/tests/lib/IO/openFile007.hs +++ /dev/null @@ -1,18 +0,0 @@ --- !!! check that we don't truncate files if the open fails - -import Control.Monad -import System.IO -import System.IO.Error - -tmp = "openFile007.out" - -main = do - h <- openFile tmp WriteMode - hPutStrLn h "hello, world" - - -- second open in write mode better fail, but better not truncate the file - tryIOError (openFile tmp WriteMode) >>= print - - hClose h - s <- readFile tmp -- make sure our "hello, world" is still there - putStr s diff --git a/testsuite/tests/lib/IO/openFile007.stdout b/testsuite/tests/lib/IO/openFile007.stdout deleted file mode 100644 index 49669047ff..0000000000 --- a/testsuite/tests/lib/IO/openFile007.stdout +++ /dev/null @@ -1,2 +0,0 @@ -Left openFile007.out: openFile: resource busy (file is locked) -hello, world diff --git a/testsuite/tests/lib/IO/openFile007.stdout-i386-unknown-mingw32 b/testsuite/tests/lib/IO/openFile007.stdout-i386-unknown-mingw32 deleted file mode 100644 index 26f0afe2b2..0000000000 --- a/testsuite/tests/lib/IO/openFile007.stdout-i386-unknown-mingw32 +++ /dev/null @@ -1,2 +0,0 @@ -Left openFile007.out: openFile: permission denied (Permission denied) -hello, world diff --git a/testsuite/tests/lib/IO/openFile008.hs b/testsuite/tests/lib/IO/openFile008.hs deleted file mode 100644 index 9c1a1c47f8..0000000000 --- a/testsuite/tests/lib/IO/openFile008.hs +++ /dev/null @@ -1,22 +0,0 @@ -import System.IO -import System.Cmd -import System.FilePath -import Text.Printf -import System.Directory -import Control.Monad - -testdir = "openFile008_testdir" - --- Test repeated opening/closing of 1000 files. This is useful for guaging --- the performance of open/close and file locking. -main = do - system ("rm -rf " ++ testdir) - createDirectory testdir - let filenames = [testdir </> printf "file%03d" (n::Int) | n <- [1..1000]] - - forM_ [1..50] $ \_ -> do - hs <- mapM (\f -> openFile f WriteMode) filenames - mapM_ hClose hs - - mapM_ removeFile filenames - removeDirectory testdir diff --git a/testsuite/tests/lib/IO/openTempFile001.hs b/testsuite/tests/lib/IO/openTempFile001.hs deleted file mode 100644 index 36598e6d5b..0000000000 --- a/testsuite/tests/lib/IO/openTempFile001.hs +++ /dev/null @@ -1,13 +0,0 @@ -module Main where - -import System.IO -import Control.Exception -import System.Directory - -main = bracket - (openTempFile "." "test.txt") - (\(f,_) -> removeFile f) - (\(f,h) -> do hPutStrLn h $ "\xa9" -- Copyright symbol - hClose h - s <- readFile f - if (s /= "\xa9\n") then error ("failed: " ++ s) else return ()) diff --git a/testsuite/tests/lib/IO/putStr001.hs b/testsuite/tests/lib/IO/putStr001.hs deleted file mode 100644 index 48b3add3f3..0000000000 --- a/testsuite/tests/lib/IO/putStr001.hs +++ /dev/null @@ -1,6 +0,0 @@ --- !!! Testing output on stdout - --- stdout is buffered, so test if its buffer --- is flushed upon program termination. - -main = putStr "Hello, world\n" diff --git a/testsuite/tests/lib/IO/putStr001.stdout b/testsuite/tests/lib/IO/putStr001.stdout deleted file mode 100644 index a5c1966771..0000000000 --- a/testsuite/tests/lib/IO/putStr001.stdout +++ /dev/null @@ -1 +0,0 @@ -Hello, world diff --git a/testsuite/tests/lib/IO/readFile001.hs b/testsuite/tests/lib/IO/readFile001.hs deleted file mode 100644 index e4a2b34cb7..0000000000 --- a/testsuite/tests/lib/IO/readFile001.hs +++ /dev/null @@ -1,26 +0,0 @@ --- !!! readFile test - -import System.IO -import System.IO.Error - -source = "readFile001.hs" -filename = "readFile001.out" - -main = do - s <- readFile source - h <- openFile filename WriteMode - hPutStrLn h s - hClose h - s <- readFile filename - - -- This open should fail, because the readFile hasn't been forced - -- and the file is therefore still locked. - tryIOError (openFile filename WriteMode) >>= print - - putStrLn s - - -- should be able to open it for writing now, because we've forced the - -- whole file. - h <- openFile filename WriteMode - - print h diff --git a/testsuite/tests/lib/IO/readFile001.stdout b/testsuite/tests/lib/IO/readFile001.stdout deleted file mode 100644 index cfb75708f9..0000000000 --- a/testsuite/tests/lib/IO/readFile001.stdout +++ /dev/null @@ -1,30 +0,0 @@ -Left readFile001.out: openFile: resource busy (file is locked) --- !!! readFile test - -import System.IO -import System.IO.Error - -source = "readFile001.hs" -filename = "readFile001.out" - -main = do - s <- readFile source - h <- openFile filename WriteMode - hPutStrLn h s - hClose h - s <- readFile filename - - -- This open should fail, because the readFile hasn't been forced - -- and the file is therefore still locked. - tryIOError (openFile filename WriteMode) >>= print - - putStrLn s - - -- should be able to open it for writing now, because we've forced the - -- whole file. - h <- openFile filename WriteMode - - print h - - -{handle: readFile001.out} diff --git a/testsuite/tests/lib/IO/readFile001.stdout-i386-unknown-mingw32 b/testsuite/tests/lib/IO/readFile001.stdout-i386-unknown-mingw32 deleted file mode 100644 index d086f3a209..0000000000 --- a/testsuite/tests/lib/IO/readFile001.stdout-i386-unknown-mingw32 +++ /dev/null @@ -1,30 +0,0 @@ -Left readFile001.out: openFile: permission denied (Permission denied) --- !!! readFile test - -import System.IO -import System.IO.Error - -source = "readFile001.hs" -filename = "readFile001.out" - -main = do - s <- readFile source - h <- openFile filename WriteMode - hPutStrLn h s - hClose h - s <- readFile filename - - -- This open should fail, because the readFile hasn't been forced - -- and the file is therefore still locked. - tryIOError (openFile filename WriteMode) >>= print - - putStrLn s - - -- should be able to open it for writing now, because we've forced the - -- whole file. - h <- openFile filename WriteMode - - print h - - -{handle: readFile001.out} diff --git a/testsuite/tests/lib/IO/readwrite001.hs b/testsuite/tests/lib/IO/readwrite001.hs deleted file mode 100644 index 4a94ef10eb..0000000000 --- a/testsuite/tests/lib/IO/readwrite001.hs +++ /dev/null @@ -1,23 +0,0 @@ --- !!! RW files - -module Main(main) where - -import System.IO -import System.Directory ( removeFile, doesFileExist ) -import Control.Monad - -main = do - f <- doesFileExist "readwrite001.inout" - when f (removeFile "readwrite001.inout") - hdl <- openFile "readwrite001.inout" ReadWriteMode - hSetBuffering hdl LineBuffering - hPutStr hdl "as" - hSeek hdl AbsoluteSeek 0 - ch <- hGetChar hdl - print ch - hPutStr hdl "ase" - hSeek hdl AbsoluteSeek 0 - putChar '\n' - ls <- hGetContents hdl - putStrLn ls - diff --git a/testsuite/tests/lib/IO/readwrite001.stdout b/testsuite/tests/lib/IO/readwrite001.stdout deleted file mode 100644 index e33ba0613d..0000000000 --- a/testsuite/tests/lib/IO/readwrite001.stdout +++ /dev/null @@ -1,3 +0,0 @@ -'a' - -aase diff --git a/testsuite/tests/lib/IO/readwrite002.hs b/testsuite/tests/lib/IO/readwrite002.hs deleted file mode 100644 index 4bb607e395..0000000000 --- a/testsuite/tests/lib/IO/readwrite002.hs +++ /dev/null @@ -1,49 +0,0 @@ --- !!! Testing RW handles - -import System.IO -import System.IO.Error -import System.Directory (removeFile, doesFileExist) -import Control.Monad -import System.Cmd - --- This test is weird, full marks to whoever dreamt it up! - -main :: IO () -main = do - let username = "readwrite002.inout" - f <- doesFileExist username - when f (removeFile username) - cd <- openFile username ReadWriteMode - - -- binary mode needed, otherwise newline translation gives - -- unpredictable results. - hSetBinaryMode cd True - --- Leva buffering on to make things more interesting: --- hSetBuffering stdin NoBuffering --- hSetBuffering stdout NoBuffering --- hSetBuffering cd NoBuffering - hPutStr cd speakString - hSeek cd AbsoluteSeek 0 - speak cd `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err - hSeek cd AbsoluteSeek 0 - hSetBuffering cd LineBuffering - speak cd `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err - return () - hSeek cd AbsoluteSeek 0 - hSetBuffering cd (BlockBuffering Nothing) - speak cd `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err - -speakString = "##############################\n" - -speak cd = do - (do - ready <- hReady cd - if ready then - hGetChar cd >>= putChar - else - return () - ready <- hReady stdin - if ready then (do { ch <- getChar; hPutChar cd ch}) - else return ()) - speak cd diff --git a/testsuite/tests/lib/IO/readwrite002.stdout b/testsuite/tests/lib/IO/readwrite002.stdout deleted file mode 100644 index 9aed0284d7..0000000000 --- a/testsuite/tests/lib/IO/readwrite002.stdout +++ /dev/null @@ -1,9 +0,0 @@ -############### - -Caught EOF -############### - -Caught EOF -############### - -Caught EOF diff --git a/testsuite/tests/lib/IO/readwrite003.hs b/testsuite/tests/lib/IO/readwrite003.hs deleted file mode 100644 index d7ee78d637..0000000000 --- a/testsuite/tests/lib/IO/readwrite003.hs +++ /dev/null @@ -1,12 +0,0 @@ -import System.IO - -file = "readwrite003.txt" - -main = do - writeFile file "ab\ncd\nef\ngh" - h <- openFile file ReadWriteMode - hGetLine h - hPutStrLn h "yz" - hClose h - h <- openBinaryFile file ReadMode - hGetContents h >>= putStr diff --git a/testsuite/tests/lib/IO/readwrite003.stdout b/testsuite/tests/lib/IO/readwrite003.stdout deleted file mode 100644 index 6b4522804e..0000000000 --- a/testsuite/tests/lib/IO/readwrite003.stdout +++ /dev/null @@ -1,4 +0,0 @@ -ab -yz -ef -gh
\ No newline at end of file diff --git a/testsuite/tests/lib/IO/utf8-test b/testsuite/tests/lib/IO/utf8-test deleted file mode 100644 index 7d0f35a448..0000000000 --- a/testsuite/tests/lib/IO/utf8-test +++ /dev/null @@ -1,3 +0,0 @@ -(∘) :: ∀ α β γ . (β → γ) → (α → β) → (α → γ) -ð‘Žð‘ð‘ð‘‘ð‘’ð‘“ð‘”ð‘–ð‘—ð‘˜ð‘™ð‘šð‘›ð‘œð‘ð‘žð‘Ÿð‘ ð‘¡ð‘¢ð‘£ð‘¤ð‘¥ð‘¦ð‘§ -X
\ No newline at end of file diff --git a/testsuite/tests/lib/IOExts/Makefile b/testsuite/tests/lib/IOExts/Makefile deleted file mode 100644 index 9101fbd40a..0000000000 --- a/testsuite/tests/lib/IOExts/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk diff --git a/testsuite/tests/lib/IOExts/all.T b/testsuite/tests/lib/IOExts/all.T deleted file mode 100644 index 518c8cccbd..0000000000 --- a/testsuite/tests/lib/IOExts/all.T +++ /dev/null @@ -1,15 +0,0 @@ -test('echo001', set_stdin("echo001.hs"), compile_and_run, ['']) - -test('hTell001', normal, compile_and_run, ['']) - -test('hTell002', normal, compile_and_run, ['']) - -test('performGC001', normal, compile_and_run, ['']) - -# optimisation screws up this test because some of the traces get commoned up -test('trace001', normal, compile_and_run, ['']) - -test('hGetBuf002', normal, compile_and_run, ['']) -test('hGetBuf003', normal, compile_and_run, ['']) -test('hPutBuf001', normal, compile_and_run, ['']) -test('hPutBuf002', extra_clean(['hPutBuf002.out']), compile_and_run, ['']) diff --git a/testsuite/tests/lib/IOExts/echo001.hs b/testsuite/tests/lib/IOExts/echo001.hs deleted file mode 100644 index 7c803589bf..0000000000 --- a/testsuite/tests/lib/IOExts/echo001.hs +++ /dev/null @@ -1,13 +0,0 @@ -module Main(main) where - -import System.IO -import Data.Char - -main = do - isT <- hIsTerminalDevice stdin - flg <- if not isT then return False else hGetEcho stdin - print flg - if not isT then hSetEcho stdin False else return () - hSetBuffering stdin NoBuffering - interact (map toUpper) - diff --git a/testsuite/tests/lib/IOExts/echo001.stdout b/testsuite/tests/lib/IOExts/echo001.stdout deleted file mode 100644 index a9d7699954..0000000000 --- a/testsuite/tests/lib/IOExts/echo001.stdout +++ /dev/null @@ -1,14 +0,0 @@ -False -MODULE MAIN(MAIN) WHERE - -IMPORT SYSTEM.IO -IMPORT DATA.CHAR - -MAIN = DO - IST <- HISTERMINALDEVICE STDIN - FLG <- IF NOT IST THEN RETURN FALSE ELSE HGETECHO STDIN - PRINT FLG - IF NOT IST THEN HSETECHO STDIN FALSE ELSE RETURN () - HSETBUFFERING STDIN NOBUFFERING - INTERACT (MAP TOUPPER) - diff --git a/testsuite/tests/lib/IOExts/hGetBuf002.hs b/testsuite/tests/lib/IOExts/hGetBuf002.hs deleted file mode 100644 index 525eeb8e36..0000000000 --- a/testsuite/tests/lib/IOExts/hGetBuf002.hs +++ /dev/null @@ -1,22 +0,0 @@ -import System.IO -import Foreign -import Foreign.C - -main = do test True; test False - -test blocking = do - h <- openBinaryFile "hGetBuf002.hs" ReadMode - - let sz = 42 - loop = 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 - - loop - diff --git a/testsuite/tests/lib/IOExts/hGetBuf002.stdout b/testsuite/tests/lib/IOExts/hGetBuf002.stdout deleted file mode 100644 index 9cbe498c5c..0000000000 --- a/testsuite/tests/lib/IOExts/hGetBuf002.stdout +++ /dev/null @@ -1,44 +0,0 @@ -import System.IO -import Foreign -import Foreign.C - -main = do test True; test False - -test blocking = do - h <- openBinaryFile "hGetBuf002.hs" ReadMode - - let sz = 42 - loop = 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 - - loop - -import System.IO -import Foreign -import Foreign.C - -main = do test True; test False - -test blocking = do - h <- openBinaryFile "hGetBuf002.hs" ReadMode - - let sz = 42 - loop = 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 - - loop - diff --git a/testsuite/tests/lib/IOExts/hGetBuf003.hs b/testsuite/tests/lib/IOExts/hGetBuf003.hs deleted file mode 100644 index 6eefdf90e8..0000000000 --- a/testsuite/tests/lib/IOExts/hGetBuf003.hs +++ /dev/null @@ -1,26 +0,0 @@ -import System.IO -import Foreign -import Foreign.C -import Control.Monad - -main = do test True; test False - -test blocking = do - h <- openBinaryFile "hGetBuf003.hs" ReadMode - - let sz = 42 - loop = do - -- mix ordinary char buffering with hGetBuf - eof <- hIsEOF h - when (not eof) $ hGetChar h >>= putChar - 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 - - loop - diff --git a/testsuite/tests/lib/IOExts/hGetBuf003.stdout b/testsuite/tests/lib/IOExts/hGetBuf003.stdout deleted file mode 100644 index ffeb291563..0000000000 --- a/testsuite/tests/lib/IOExts/hGetBuf003.stdout +++ /dev/null @@ -1,52 +0,0 @@ -import System.IO -import Foreign -import Foreign.C -import Control.Monad - -main = do test True; test False - -test blocking = do - h <- openBinaryFile "hGetBuf003.hs" ReadMode - - let sz = 42 - loop = do - -- mix ordinary char buffering with hGetBuf - eof <- hIsEOF h - when (not eof) $ hGetChar h >>= putChar - 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 - - loop - -import System.IO -import Foreign -import Foreign.C -import Control.Monad - -main = do test True; test False - -test blocking = do - h <- openBinaryFile "hGetBuf003.hs" ReadMode - - let sz = 42 - loop = do - -- mix ordinary char buffering with hGetBuf - eof <- hIsEOF h - when (not eof) $ hGetChar h >>= putChar - 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 - - loop - diff --git a/testsuite/tests/lib/IOExts/hPutBuf001.hs b/testsuite/tests/lib/IOExts/hPutBuf001.hs deleted file mode 100644 index fa7e076d41..0000000000 --- a/testsuite/tests/lib/IOExts/hPutBuf001.hs +++ /dev/null @@ -1,7 +0,0 @@ -import System.IO -import Foreign -import Foreign.C - -main = do - hSetBinaryMode stdout True - withCStringLen "hello world\n" $ \(ptr,len) -> hPutBuf stdout ptr len diff --git a/testsuite/tests/lib/IOExts/hPutBuf001.stdout b/testsuite/tests/lib/IOExts/hPutBuf001.stdout deleted file mode 100644 index 3b18e512db..0000000000 --- a/testsuite/tests/lib/IOExts/hPutBuf001.stdout +++ /dev/null @@ -1 +0,0 @@ -hello world diff --git a/testsuite/tests/lib/IOExts/hPutBuf002.hs b/testsuite/tests/lib/IOExts/hPutBuf002.hs deleted file mode 100644 index a7ea2eed03..0000000000 --- a/testsuite/tests/lib/IOExts/hPutBuf002.hs +++ /dev/null @@ -1,9 +0,0 @@ -import System.IO -import Foreign -import Foreign.C - --- !!! this test failed to write anything in GHC 5.00.2 -main = do - h <- openBinaryFile "hPutBuf002.out" ReadWriteMode - withCStringLen "hello world\n" $ \(ptr,len) -> hPutBuf h ptr len - hFileSize h >>= print diff --git a/testsuite/tests/lib/IOExts/hPutBuf002.stdout b/testsuite/tests/lib/IOExts/hPutBuf002.stdout deleted file mode 100644 index 48082f72f0..0000000000 --- a/testsuite/tests/lib/IOExts/hPutBuf002.stdout +++ /dev/null @@ -1 +0,0 @@ -12 diff --git a/testsuite/tests/lib/IOExts/hTell001.hs b/testsuite/tests/lib/IOExts/hTell001.hs deleted file mode 100644 index 6b26eecb97..0000000000 --- a/testsuite/tests/lib/IOExts/hTell001.hs +++ /dev/null @@ -1,63 +0,0 @@ --- !!! Testing hGetPosn and hSetPosn -module Main(main) where - -import System.IO - -getPosnAndPrint h = do - x <- hTell h - v <- hGetChar h - putStrLn ("At position: " ++ show x ++ ", found: " ++ show v) - return x - -recordDoAndRepos h a = do - x <- getPosnAndPrint h - a - hSeek h AbsoluteSeek x - getPosnAndPrint h - return () - -recordDoAndRepos2 h a = do - x <- getPosnAndPrint h - a - hSeek h AbsoluteSeek x - getPosnAndPrint h - return () - -recordDoAndRepos3 h a = do - x <- getPosnAndPrint h - a - hSeek h SeekFromEnd (negate (x + 1)) - getPosnAndPrint h - return () - -file = "hTell001.hs" - -main :: IO () -main = do - h <- openBinaryFile file ReadMode - recordDoAndRepos h $ - recordDoAndRepos h $ - recordDoAndRepos h $ - recordDoAndRepos h $ - recordDoAndRepos h $ - putStrLn "" - hClose h - putStrLn "\nUsing hSeek/AbsoluteSeek: " - h <- openBinaryFile file ReadMode - recordDoAndRepos2 h $ - recordDoAndRepos2 h $ - recordDoAndRepos2 h $ - recordDoAndRepos2 h $ - recordDoAndRepos2 h $ - putStrLn "" - - hClose h - putStrLn "\nUsing hSeek/SeekFromEnd: " - putStrLn "(Don't worry if you're seeing differing numbers here, it might be down to '\\n' vs '\\r\\n')" - h <- openBinaryFile file ReadMode - recordDoAndRepos3 h $ - recordDoAndRepos3 h $ - recordDoAndRepos3 h $ - recordDoAndRepos3 h $ - recordDoAndRepos3 h $ - putStrLn "" diff --git a/testsuite/tests/lib/IOExts/hTell001.stdout b/testsuite/tests/lib/IOExts/hTell001.stdout deleted file mode 100644 index 7e22e69a93..0000000000 --- a/testsuite/tests/lib/IOExts/hTell001.stdout +++ /dev/null @@ -1,38 +0,0 @@ -At position: 0, found: '-' -At position: 1, found: '-' -At position: 2, found: ' ' -At position: 3, found: '!' -At position: 4, found: '!' - -At position: 4, found: '!' -At position: 3, found: '!' -At position: 2, found: ' ' -At position: 1, found: '-' -At position: 0, found: '-' - -Using hSeek/AbsoluteSeek: -At position: 0, found: '-' -At position: 1, found: '-' -At position: 2, found: ' ' -At position: 3, found: '!' -At position: 4, found: '!' - -At position: 4, found: '!' -At position: 3, found: '!' -At position: 2, found: ' ' -At position: 1, found: '-' -At position: 0, found: '-' - -Using hSeek/SeekFromEnd: -(Don't worry if you're seeing differing numbers here, it might be down to '\n' vs '\r\n') -At position: 0, found: '-' -At position: 1, found: '-' -At position: 2, found: ' ' -At position: 3, found: '!' -At position: 4, found: '!' - -At position: 1376, found: 'n' -At position: 1377, found: ' ' -At position: 1378, found: '"' -At position: 1379, found: '"' -At position: 1380, found: '\n' diff --git a/testsuite/tests/lib/IOExts/hTell002.hs b/testsuite/tests/lib/IOExts/hTell002.hs deleted file mode 100644 index b790db8fe8..0000000000 --- a/testsuite/tests/lib/IOExts/hTell002.hs +++ /dev/null @@ -1,33 +0,0 @@ --- !!! Testing hSeek -module Main(main) where - -import System.Directory -import System.IO - -main :: IO () -main = do - h <- openFile "tst-seek" WriteMode - hSetEncoding h utf8 -- hSeek/hTell work with Unicode streams - hPutStr h "test string1" - -- seek to EOF should be cool.. - hSeek h SeekFromEnd 0 - hPutStr h "test string2" - -- seek past EOF should now also be cool.. - hSeek h SeekFromEnd 3 - hPutStr h "test string3" - hSeek h AbsoluteSeek 13 - hPutStr h "test string4" - x <- hTell h - print x - hSeek h AbsoluteSeek 30 - x1 <- hTell h - hPutStr h "人間虫" -- we should be able to output Unicode too - x2 <- hTell h - print (x2 - x1) - hPutStr h "filler" - hClose h - h <- openFile "tst-seek" ReadMode - hSetEncoding h utf8 - str <- hGetContents h - putStrLn str - removeFile "tst-seek" diff --git a/testsuite/tests/lib/IOExts/hTell002.stdout b/testsuite/tests/lib/IOExts/hTell002.stdout Binary files differdeleted file mode 100644 index 52696f8a2c..0000000000 --- a/testsuite/tests/lib/IOExts/hTell002.stdout +++ /dev/null diff --git a/testsuite/tests/lib/IOExts/performGC001.hs b/testsuite/tests/lib/IOExts/performGC001.hs deleted file mode 100644 index f14dab004c..0000000000 --- a/testsuite/tests/lib/IOExts/performGC001.hs +++ /dev/null @@ -1,5 +0,0 @@ --- !!! test System.Mem.performGC - -import System.Mem - -main = performGC diff --git a/testsuite/tests/lib/IOExts/performGC001.stdout b/testsuite/tests/lib/IOExts/performGC001.stdout deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/lib/IOExts/performGC001.stdout +++ /dev/null diff --git a/testsuite/tests/lib/IOExts/trace001.hs b/testsuite/tests/lib/IOExts/trace001.hs deleted file mode 100644 index 2ed61d486e..0000000000 --- a/testsuite/tests/lib/IOExts/trace001.hs +++ /dev/null @@ -1,10 +0,0 @@ -import System.IO -import Debug.Trace - -main = do - hPutStr stderr - (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") diff --git a/testsuite/tests/lib/IOExts/trace001.stderr b/testsuite/tests/lib/IOExts/trace001.stderr deleted file mode 100644 index dfe965af21..0000000000 --- a/testsuite/tests/lib/IOExts/trace001.stderr +++ /dev/null @@ -1,14 +0,0 @@ -one -fish -two -fish -red -fish -blue -fishONE -FISH -TWO -FISH -RED -FISH -BLUE diff --git a/testsuite/tests/lib/IOExts/trace001.stdout b/testsuite/tests/lib/IOExts/trace001.stdout deleted file mode 100644 index 23ddbb4550..0000000000 --- a/testsuite/tests/lib/IOExts/trace001.stdout +++ /dev/null @@ -1 +0,0 @@ -FISH
\ No newline at end of file diff --git a/testsuite/tests/lib/libposix/Makefile b/testsuite/tests/lib/libposix/Makefile deleted file mode 100644 index 9101fbd40a..0000000000 --- a/testsuite/tests/lib/libposix/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk diff --git a/testsuite/tests/lib/libposix/all.T b/testsuite/tests/lib/libposix/all.T deleted file mode 100644 index a266040d3d..0000000000 --- a/testsuite/tests/lib/libposix/all.T +++ /dev/null @@ -1,15 +0,0 @@ -test('posix002', [ reqlib('unix'), omit_ways(prof_ways) ], - compile_and_run, ['']) - -# Skip on mingw32: assumes existence of 'pwd' and /tmp -test('posix003', if_os('mingw32', skip), compile_and_run, ['']) - -test('posix004', [ reqlib('unix') ], compile_and_run, ['']) - -test('posix005', [reqlib('unix'), expect_broken(5648)], compile_and_run, ['']) - -test('posix006', reqlib('unix'), compile_and_run, ['']) -test('posix009', [ omit_ways(threaded_ways), reqlib('unix') ], compile_and_run, ['']) -test('posix010', reqlib('unix'), compile_and_run, ['']) - -test('posix014', [ reqlib('unix') ], compile_and_run, ['']) diff --git a/testsuite/tests/lib/libposix/posix002.hs b/testsuite/tests/lib/libposix/posix002.hs deleted file mode 100644 index c5909abd6f..0000000000 --- a/testsuite/tests/lib/libposix/posix002.hs +++ /dev/null @@ -1,4 +0,0 @@ -import System.Posix.Process - -main = - executeFile "printenv" True [] (Just [("ONE","1"),("TWO","2")]) diff --git a/testsuite/tests/lib/libposix/posix002.stdout b/testsuite/tests/lib/libposix/posix002.stdout deleted file mode 100644 index 5e17a60f42..0000000000 --- a/testsuite/tests/lib/libposix/posix002.stdout +++ /dev/null @@ -1,2 +0,0 @@ -ONE=1 -TWO=2 diff --git a/testsuite/tests/lib/libposix/posix003.hs b/testsuite/tests/lib/libposix/posix003.hs deleted file mode 100644 index b28f9f7dbf..0000000000 --- a/testsuite/tests/lib/libposix/posix003.hs +++ /dev/null @@ -1,17 +0,0 @@ - -import Control.Monad -import Data.Char -import System.Exit -import System.IO -import System.Process - -main = do hw <- openFile "po003.out" WriteMode - ph <- runProcess "pwd" [] (Just "/dev") Nothing Nothing (Just hw) Nothing - ec <- waitForProcess ph - hClose hw - unless (ec == ExitSuccess) $ error "pwd failed" - hr <- openFile "po003.out" ReadMode - output <- hGetContents hr - putStrLn ("Got: " ++ show (filter (not . isSpace) output)) - hClose hr - diff --git a/testsuite/tests/lib/libposix/posix003.stdout b/testsuite/tests/lib/libposix/posix003.stdout deleted file mode 100644 index 5206ef3c22..0000000000 --- a/testsuite/tests/lib/libposix/posix003.stdout +++ /dev/null @@ -1 +0,0 @@ -Got: "/dev" diff --git a/testsuite/tests/lib/libposix/posix004.hs b/testsuite/tests/lib/libposix/posix004.hs deleted file mode 100644 index 20e2af2367..0000000000 --- a/testsuite/tests/lib/libposix/posix004.hs +++ /dev/null @@ -1,44 +0,0 @@ - -import System.Exit (ExitCode(..), exitWith) -import System.Posix.Process -import System.Posix.Signals - -main = do test1 - test2 - test3 - test4 - putStrLn "I'm happy." - -test1 = do - forkProcess $ raiseSignal floatingPointException - Just (pid, tc) <- getAnyProcessStatus True False - case tc of - Terminated sig | sig == floatingPointException -> return () - _ -> error "unexpected termination cause" - -test2 = do - forkProcess $ exitImmediately (ExitFailure 42) - Just (pid, tc) <- getAnyProcessStatus True False - case tc of - Exited (ExitFailure 42) -> return () - _ -> error "unexpected termination cause (2)" - -test3 = do - forkProcess $ exitImmediately ExitSuccess - Just (pid, tc) <- getAnyProcessStatus True False - case tc of - Exited ExitSuccess -> return () - _ -> error "unexpected termination cause (3)" - -test4 = do - forkProcess $ raiseSignal softwareStop - Just (pid, tc) <- getAnyProcessStatus True True - case tc of - Stopped sig | sig == softwareStop -> do - signalProcess killProcess pid - Just (pid, tc) <- getAnyProcessStatus True True - case tc of - Terminated sig | sig == killProcess -> return () - _ -> error "unexpected termination cause (5)" - _ -> error "unexpected termination cause (4)" - diff --git a/testsuite/tests/lib/libposix/posix004.stdout b/testsuite/tests/lib/libposix/posix004.stdout deleted file mode 100644 index 8ed7ee54d5..0000000000 --- a/testsuite/tests/lib/libposix/posix004.stdout +++ /dev/null @@ -1 +0,0 @@ -I'm happy. diff --git a/testsuite/tests/lib/libposix/posix005.hs b/testsuite/tests/lib/libposix/posix005.hs deleted file mode 100644 index 9ca569cccc..0000000000 --- a/testsuite/tests/lib/libposix/posix005.hs +++ /dev/null @@ -1,21 +0,0 @@ - -import System.IO -import System.Posix.Env - -main = do - hSetBuffering stdout NoBuffering - term <- getEnvVar "TERM" - putStrLn term - setEnvironment [("one","1"),("two","2")] - getEnvironment >>= print - setEnv "foo" "bar" True - getEnvironment >>= print - setEnv "foo" "baz" True - getEnvironment >>= print - setEnv "fu" "bar" True - getEnvironment >>= print - unsetEnv "foo" - getEnvironment >>= print - setEnvironment [] - getEnvironment >>= print - diff --git a/testsuite/tests/lib/libposix/posix005.stdout b/testsuite/tests/lib/libposix/posix005.stdout deleted file mode 100644 index 9896f43da7..0000000000 --- a/testsuite/tests/lib/libposix/posix005.stdout +++ /dev/null @@ -1,7 +0,0 @@ -emacs -[("one","1"),("two","2")] -[("one","1"),("two","2"),("foo","bar")] -[("one","1"),("two","2"),("foo","baz")] -[("one","1"),("two","2"),("foo","baz"),("fu","bar")] -[("one","1"),("two","2"),("fu","bar")] -[] diff --git a/testsuite/tests/lib/libposix/posix006.hs b/testsuite/tests/lib/libposix/posix006.hs deleted file mode 100644 index 697e4e6e20..0000000000 --- a/testsuite/tests/lib/libposix/posix006.hs +++ /dev/null @@ -1,18 +0,0 @@ - -import System.Posix.Time -import System.Posix.Unistd -import System.Posix.Signals - -main = do start <- epochTime - blockSignals reservedSignals -- see #4504 - sleep 1 - finish <- epochTime - let slept = finish - start - if slept >= 1 && slept <= 2 - then putStrLn "OK" - else do putStr "Started: " - print start - putStr "Finished: " - print finish - putStr "Slept: " - print slept diff --git a/testsuite/tests/lib/libposix/posix006.stdout b/testsuite/tests/lib/libposix/posix006.stdout deleted file mode 100644 index d86bac9de5..0000000000 --- a/testsuite/tests/lib/libposix/posix006.stdout +++ /dev/null @@ -1 +0,0 @@ -OK diff --git a/testsuite/tests/lib/libposix/posix009.hs b/testsuite/tests/lib/libposix/posix009.hs deleted file mode 100644 index 067d3a9f29..0000000000 --- a/testsuite/tests/lib/libposix/posix009.hs +++ /dev/null @@ -1,15 +0,0 @@ -import System.Posix.Signals -import System.Posix.Unistd - -main = do - putStrLn "Blocking real time alarms." - blockSignals (addSignal realTimeAlarm reservedSignals) - putStrLn "Scheduling an alarm in 2 seconds..." - scheduleAlarm 2 - putStrLn "Sleeping 5 seconds." - sleep 5 - putStrLn "Woken up" - ints <- getPendingSignals - putStrLn "Checking pending interrupts for RealTimeAlarm" - print (inSignalSet realTimeAlarm ints) - diff --git a/testsuite/tests/lib/libposix/posix009.stdout b/testsuite/tests/lib/libposix/posix009.stdout deleted file mode 100644 index d2946753e2..0000000000 --- a/testsuite/tests/lib/libposix/posix009.stdout +++ /dev/null @@ -1,6 +0,0 @@ -Blocking real time alarms. -Scheduling an alarm in 2 seconds... -Sleeping 5 seconds. -Woken up -Checking pending interrupts for RealTimeAlarm -True diff --git a/testsuite/tests/lib/libposix/posix010.hs b/testsuite/tests/lib/libposix/posix010.hs deleted file mode 100644 index 420d2107fa..0000000000 --- a/testsuite/tests/lib/libposix/posix010.hs +++ /dev/null @@ -1,16 +0,0 @@ -import System.Posix - -main = do - root <- getUserEntryForName "root" - putStrLn (ue2String root) - root' <- getUserEntryForID (userID root) - putStrLn (ue2String root') - if homeDirectory root == homeDirectory root' && - userShell root == userShell root' - then putStrLn "OK" - else putStrLn "Mismatch" - -ue2String ue = concat [name, ":", show uid, ":", show gid] - where name = userName ue - uid = userID ue - gid = userGroupID ue diff --git a/testsuite/tests/lib/libposix/posix010.stdout b/testsuite/tests/lib/libposix/posix010.stdout deleted file mode 100644 index 77a5024498..0000000000 --- a/testsuite/tests/lib/libposix/posix010.stdout +++ /dev/null @@ -1,3 +0,0 @@ -root:0:0 -root:0:0 -OK diff --git a/testsuite/tests/lib/libposix/posix014.hs b/testsuite/tests/lib/libposix/posix014.hs deleted file mode 100644 index 9d844b20ce..0000000000 --- a/testsuite/tests/lib/libposix/posix014.hs +++ /dev/null @@ -1,13 +0,0 @@ --- !! Basic pipe usage -module Main (main) where - -import System.Posix - -main = do - (rd, wd) <- createPipe - pid <- forkProcess $ do (str, _) <- fdRead rd 32 - putStrLn str - fdWrite wd "Hi, there - forked child calling" - getProcessStatus True False pid - return () - diff --git a/testsuite/tests/lib/libposix/posix014.stdout b/testsuite/tests/lib/libposix/posix014.stdout deleted file mode 100644 index cab0a57734..0000000000 --- a/testsuite/tests/lib/libposix/posix014.stdout +++ /dev/null @@ -1 +0,0 @@ -Hi, there - forked child calling diff --git a/testsuite/tests/lib/should_run/4006.hs b/testsuite/tests/lib/should_run/4006.hs deleted file mode 100644 index 662b0f62e3..0000000000 --- a/testsuite/tests/lib/should_run/4006.hs +++ /dev/null @@ -1,8 +0,0 @@ -import System.Process - -testUnicode :: String -> IO String -testUnicode str = readProcess "printf" ["%s", str] "" - -main = do - testUnicode "It works here" >>= putStrLn - testUnicode "РздеÑÑŒ ÑломалоÑÑŒ" >>= putStrLn diff --git a/testsuite/tests/lib/should_run/4006.stdout b/testsuite/tests/lib/should_run/4006.stdout deleted file mode 100644 index 9db8a8ced2..0000000000 --- a/testsuite/tests/lib/should_run/4006.stdout +++ /dev/null @@ -1,2 +0,0 @@ -It works here -РздеÑÑŒ ÑломалоÑÑŒ diff --git a/testsuite/tests/lib/should_run/Makefile b/testsuite/tests/lib/should_run/Makefile deleted file mode 100644 index 9101fbd40a..0000000000 --- a/testsuite/tests/lib/should_run/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk diff --git a/testsuite/tests/lib/should_run/Memo1.lhs b/testsuite/tests/lib/should_run/Memo1.lhs deleted file mode 100644 index 796f6121e4..0000000000 --- a/testsuite/tests/lib/should_run/Memo1.lhs +++ /dev/null @@ -1,142 +0,0 @@ -% $Id: Memo.lhs,v 1.1 2005/12/16 10:46:05 simonmar Exp $ -% -% (c) The GHC Team, 1999 -% -% Hashing memo tables. - -\begin{code} -{-# LANGUAGE CPP #-} - -module Memo1 - {-# DEPRECATED "This module is unmaintained, and will disappear soon" #-} -#ifndef __PARALLEL_HASKELL__ - ( memo -- :: (a -> b) -> a -> b - , memoSized -- :: Int -> (a -> b) -> a -> b - ) -#endif - where - -#ifndef __PARALLEL_HASKELL__ - -import System.Mem.StableName ( StableName, makeStableName, hashStableName ) -import System.Mem.Weak ( Weak, mkWeakPtr, mkWeak, deRefWeak, finalize ) -import Data.Array.IO ( IOArray, newArray, readArray, writeArray ) -import System.IO.Unsafe ( unsafePerformIO ) -import Control.Concurrent.MVar ( MVar, newMVar, putMVar, takeMVar ) -\end{code} - ------------------------------------------------------------------------------ -Memo table representation. - -The representation is this: a fixed-size hash table where each bucket -is a list of table entries, of the form (key,value). - -The key in this case is (StableName key), and we use hashStableName to -hash it. - -It's important that we can garbage collect old entries in the table -when the key is no longer reachable in the heap. Hence the value part -of each table entry is (Weak val), where the weak pointer "key" is the -key for our memo table, and 'val' is the value of this memo table -entry. When the key becomes unreachable, a finalizer will fire and -remove this entry from the hash bucket, and further attempts to -dereference the weak pointer will return Nothing. References from -'val' to the key are ignored (see the semantics of weak pointers in -the documentation). - -\begin{code} -type MemoTable key val - = MVar ( - Int, -- current table size - IOArray Int [MemoEntry key val] -- hash table - ) - --- a memo table entry: compile with -funbox-strict-fields to eliminate --- the boxes around the StableName and Weak fields. -data MemoEntry key val = MemoEntry !(StableName key) !(Weak val) -\end{code} - -We use an MVar to the hash table, so that several threads may safely -access it concurrently. This includes the finalization threads that -remove entries from the table. - -ToDo: Can efficiency be improved at all? - -\begin{code} -memo :: (a -> b) -> a -> b -memo f = memoSized default_table_size f - -default_table_size = 1001 - --- Our memo functions are *strict*. Lazy memo functions tend to be --- less useful because it is less likely you'll get a memo table hit --- for a thunk. This change was made to match Hugs's Memo --- implementation, and as the result of feedback from Conal Elliot --- <conal@microsoft.com>. - -memoSized :: Int -> (a -> b) -> a -> b -memoSized size f = strict (lazyMemoSized size f) - -strict = ($!) - -lazyMemoSized :: Int -> (a -> b) -> a -> b -lazyMemoSized size f = - let (table,weak) = unsafePerformIO ( - do { tbl <- newArray (0,size) [] - ; mvar <- newMVar (size,tbl) - ; weak <- mkWeakPtr mvar (Just (table_finalizer tbl size)) - ; return (mvar,weak) - }) - in memo' f table weak - -table_finalizer :: IOArray Int [MemoEntry key val] -> Int -> IO () -table_finalizer table size = - sequence_ [ finalizeBucket i | i <- [0..size] ] - where - finalizeBucket i = do - bucket <- readArray table i - sequence_ [ finalize w | MemoEntry _ w <- bucket ] - -memo' :: (a -> b) -> MemoTable a b -> Weak (MemoTable a b) -> a -> b -memo' f ref weak_ref = \k -> unsafePerformIO $ do - stable_key <- makeStableName k - (size, table) <- takeMVar ref - let hash_key = hashStableName stable_key `mod` size - bucket <- readArray table hash_key - lkp <- lookupSN stable_key bucket - - case lkp of - Just result -> do - putMVar ref (size,table) - return result - Nothing -> do - let result = f k - weak <- mkWeak k result (Just (finalizer hash_key stable_key weak_ref)) - writeArray table hash_key (MemoEntry stable_key weak : bucket) - putMVar ref (size,table) - return result - -finalizer :: Int -> StableName a -> Weak (MemoTable a b) -> IO () -finalizer hash_key stable_key weak_ref = - do r <- deRefWeak weak_ref - case r of - Nothing -> return () - Just mvar -> do - (size,table) <- takeMVar mvar - bucket <- readArray table hash_key - let new_bucket = [ e | e@(MemoEntry sn weak) <- bucket, - sn /= stable_key ] - writeArray table hash_key new_bucket - putMVar mvar (size,table) - -lookupSN :: StableName key -> [MemoEntry key val] -> IO (Maybe val) -lookupSN sn [] = sn `seq` return Nothing -- make it strict in sn -lookupSN sn (MemoEntry sn' weak : xs) - | sn == sn' = do maybe_item <- deRefWeak weak - case maybe_item of - Nothing -> error ("dead weak pair: " ++ - show (hashStableName sn)) - Just v -> return (Just v) - | otherwise = lookupSN sn xs -#endif -\end{code} diff --git a/testsuite/tests/lib/should_run/Memo2.lhs b/testsuite/tests/lib/should_run/Memo2.lhs deleted file mode 100644 index 5193ec2899..0000000000 --- a/testsuite/tests/lib/should_run/Memo2.lhs +++ /dev/null @@ -1,142 +0,0 @@ -% $Id: Memo.lhs,v 1.1 2005/12/16 10:46:05 simonmar Exp $ -% -% (c) The GHC Team, 1999 -% -% Hashing memo tables. - -\begin{code} -{-# LANGUAGE CPP #-} - -module Memo2 - {-# DEPRECATED "This module is unmaintained, and will disappear soon" #-} -#ifndef __PARALLEL_HASKELL__ - ( memo -- :: (a -> b) -> a -> b - , memoSized -- :: Int -> (a -> b) -> a -> b - ) -#endif - where - -#ifndef __PARALLEL_HASKELL__ - -import System.Mem.StableName ( StableName, makeStableName, hashStableName ) -import System.Mem.Weak ( Weak, mkWeakPtr, mkWeak, deRefWeak, finalize ) -import Data.Array.IO ( IOArray, newArray, readArray, writeArray ) -import System.IO.Unsafe ( unsafePerformIO ) -import Control.Concurrent.MVar ( MVar, newMVar, putMVar, takeMVar ) -\end{code} - ------------------------------------------------------------------------------ -Memo table representation. - -The representation is this: a fixed-size hash table where each bucket -is a list of table entries, of the form (key,value). - -The key in this case is (StableName key), and we use hashStableName to -hash it. - -It's important that we can garbage collect old entries in the table -when the key is no longer reachable in the heap. Hence the value part -of each table entry is (Weak val), where the weak pointer "key" is the -key for our memo table, and 'val' is the value of this memo table -entry. When the key becomes unreachable, a finalizer will fire and -remove this entry from the hash bucket, and further attempts to -dereference the weak pointer will return Nothing. References from -'val' to the key are ignored (see the semantics of weak pointers in -the documentation). - -\begin{code} -type MemoTable key val - = MVar ( - Int, -- current table size - IOArray Int [MemoEntry key val] -- hash table - ) - --- a memo table entry: compile with -funbox-strict-fields to eliminate --- the boxes around the StableName and Weak fields. -data MemoEntry key val = MemoEntry !(StableName key) !(Weak val) -\end{code} - -We use an MVar to the hash table, so that several threads may safely -access it concurrently. This includes the finalization threads that -remove entries from the table. - -ToDo: Can efficiency be improved at all? - -\begin{code} -memo :: (a -> b) -> a -> b -memo f = memoSized default_table_size f - -default_table_size = 1001 - --- Our memo functions are *strict*. Lazy memo functions tend to be --- less useful because it is less likely you'll get a memo table hit --- for a thunk. This change was made to match Hugs's Memo --- implementation, and as the result of feedback from Conal Elliot --- <conal@microsoft.com>. - -memoSized :: Int -> (a -> b) -> a -> b -memoSized size f = strict (lazyMemoSized size f) - -strict = ($!) - -lazyMemoSized :: Int -> (a -> b) -> a -> b -lazyMemoSized size f = - let (table,weak) = unsafePerformIO ( - do { tbl <- newArray (0,size) [] - ; mvar <- newMVar (size,tbl) - ; weak <- mkWeakPtr mvar (Just (table_finalizer tbl size)) - ; return (mvar,weak) - }) - in memo' f table weak - -table_finalizer :: IOArray Int [MemoEntry key val] -> Int -> IO () -table_finalizer table size = - sequence_ [ finalizeBucket i | i <- [0..size] ] - where - finalizeBucket i = do - bucket <- readArray table i - sequence_ [ finalize w | MemoEntry _ w <- bucket ] - -memo' :: (a -> b) -> MemoTable a b -> Weak (MemoTable a b) -> a -> b -memo' f ref weak_ref = \k -> unsafePerformIO $ do - stable_key <- makeStableName k - (size, table) <- takeMVar ref - let hash_key = hashStableName stable_key `mod` size - bucket <- readArray table hash_key - lkp <- lookupSN stable_key bucket - - case lkp of - Just result -> do - putMVar ref (size,table) - return result - Nothing -> do - let result = f k - weak <- mkWeak k result (Just (finalizer hash_key stable_key weak_ref)) - writeArray table hash_key (MemoEntry stable_key weak : bucket) - putMVar ref (size,table) - return result - -finalizer :: Int -> StableName a -> Weak (MemoTable a b) -> IO () -finalizer hash_key stable_key weak_ref = - do r <- deRefWeak weak_ref - case r of - Nothing -> return () - Just mvar -> do - (size,table) <- takeMVar mvar - bucket <- readArray table hash_key - let new_bucket = [ e | e@(MemoEntry sn weak) <- bucket, - sn /= stable_key ] - writeArray table hash_key new_bucket - putMVar mvar (size,table) - -lookupSN :: StableName key -> [MemoEntry key val] -> IO (Maybe val) -lookupSN sn [] = sn `seq` return Nothing -- make it strict in sn -lookupSN sn (MemoEntry sn' weak : xs) - | sn == sn' = do maybe_item <- deRefWeak weak - case maybe_item of - Nothing -> error ("dead weak pair: " ++ - show (hashStableName sn)) - Just v -> return (Just v) - | otherwise = lookupSN sn xs -#endif -\end{code} diff --git a/testsuite/tests/lib/should_run/addr001.hs b/testsuite/tests/lib/should_run/addr001.hs deleted file mode 100644 index 436a066063..0000000000 --- a/testsuite/tests/lib/should_run/addr001.hs +++ /dev/null @@ -1,10 +0,0 @@ --- !!! Testing that Show for Addr is OK.. -module Main(main) where - -import Foreign.Ptr - -main :: IO () -main = do - print (nullPtr `plusPtr` maxBound) - print (nullPtr `plusPtr` minBound) - diff --git a/testsuite/tests/lib/should_run/addr001.stdout b/testsuite/tests/lib/should_run/addr001.stdout deleted file mode 100644 index e098b1be49..0000000000 --- a/testsuite/tests/lib/should_run/addr001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -0x7fffffff -0x80000000 diff --git a/testsuite/tests/lib/should_run/addr001.stdout-alpha-dec-osf3 b/testsuite/tests/lib/should_run/addr001.stdout-alpha-dec-osf3 deleted file mode 100644 index f38ea71861..0000000000 --- a/testsuite/tests/lib/should_run/addr001.stdout-alpha-dec-osf3 +++ /dev/null @@ -1,2 +0,0 @@ -0x7fffffffffffffff -0x8000000000000000 diff --git a/testsuite/tests/lib/should_run/addr001.stdout-mips-sgi-irix b/testsuite/tests/lib/should_run/addr001.stdout-mips-sgi-irix deleted file mode 100644 index f38ea71861..0000000000 --- a/testsuite/tests/lib/should_run/addr001.stdout-mips-sgi-irix +++ /dev/null @@ -1,2 +0,0 @@ -0x7fffffffffffffff -0x8000000000000000 diff --git a/testsuite/tests/lib/should_run/addr001.stdout-ws-64 b/testsuite/tests/lib/should_run/addr001.stdout-ws-64 deleted file mode 100644 index f38ea71861..0000000000 --- a/testsuite/tests/lib/should_run/addr001.stdout-ws-64 +++ /dev/null @@ -1,2 +0,0 @@ -0x7fffffffffffffff -0x8000000000000000 diff --git a/testsuite/tests/lib/should_run/addr001.stdout-x86_64-unknown-openbsd b/testsuite/tests/lib/should_run/addr001.stdout-x86_64-unknown-openbsd deleted file mode 100644 index f38ea71861..0000000000 --- a/testsuite/tests/lib/should_run/addr001.stdout-x86_64-unknown-openbsd +++ /dev/null @@ -1,2 +0,0 @@ -0x7fffffffffffffff -0x8000000000000000 diff --git a/testsuite/tests/lib/should_run/all.T b/testsuite/tests/lib/should_run/all.T deleted file mode 100644 index d113d21651..0000000000 --- a/testsuite/tests/lib/should_run/all.T +++ /dev/null @@ -1,69 +0,0 @@ - -test('char001', normal, compile_and_run, ['']) -test('char002', normal, compile_and_run, ['']) - -test('cstring001', normal, compile_and_run, ['']) - -test('length001', - # This fails without -O, as it relies on a RULE being applied - expect_fail_for(['normal', 'threaded1', 'llvm']), - compile_and_run, - ['']) - -test('ratio001', normal, compile_and_run, ['']) - -test('rand001', reqlib('random'), compile_and_run, ['']) -test('reads001', normal, compile_and_run, ['']) -test('show001', normal, compile_and_run, ['']) -test('text001', normal, compile_and_run, ['']) - -test('tup001', normal, compile_and_run, ['']) - -test('addr001', normal, compile_and_run, ['']) -test('dynamic001', normal, compile_and_run, ['']) -test('dynamic002', normal, compile_and_run, ['']) -test('dynamic003', extra_run_opts('+RTS -K32m -RTS'), compile_and_run, ['']) -test('dynamic004', normal, compile_and_run, ['']) -test('dynamic005', normal, compile_and_run, ['']) -test('enum01', skip_if_fast, compile_and_run, ['-cpp']) -test('enum02', skip_if_fast, compile_and_run, ['-cpp']) -test('enum03', skip_if_fast, compile_and_run, ['-cpp']) -test('enum04', normal, compile_and_run, ['']) -test('exceptionsrun001', normal, compile_and_run, ['']) -test('exceptionsrun002', normal, compile_and_run, ['']) -test('list001' , skip_if_fast, compile_and_run, ['']) -test('list002', skip_if_fast, compile_and_run, ['']) -test('list003', skip_if_fast, compile_and_run, ['']) - -test('memo001', - [skip_if_fast, - extra_run_opts('+RTS -A10k -RTS'), - extra_clean(['Memo1.hi', 'Memo1.o'])], - multimod_compile_and_run, - ['memo001','']) - -test('memo002', - [skip_if_fast, - extra_run_opts('20'), - extra_clean(['Memo2.hi', 'Memo2.o'])], - multimod_compile_and_run, ['memo002','']) - -test('packedstring001', reqlib('packedstring'), compile_and_run, ['-package packedstring']) - -test('stableptr001', - [skip_if_fast, extra_run_opts('+RTS -K8m -RTS')], - compile_and_run, ['']) -test('stableptr003', normal, compile_and_run, ['']) -test('stableptr004', extra_run_opts('+RTS -K4m -RTS'), compile_and_run, ['']) -test('stableptr005', normal, compile_and_run, ['']) - -test('weak001', normal, compile_and_run, ['']) - -# In the 65001 codepage, we can't even cat the expected output on msys: -# $ cat 4006.stdout -# It works here -# cat: write error: Permission denied -# Seems to be a known problem, e.g. -# http://mingw-users.1079350.n2.nabble.com/Bug-re-Unicode-on-the-console-td3121717.html -test('4006', if_msys(expect_fail), compile_and_run, ['']) - diff --git a/testsuite/tests/lib/should_run/char001.hs b/testsuite/tests/lib/should_run/char001.hs deleted file mode 100644 index 2fb0edce0f..0000000000 --- a/testsuite/tests/lib/should_run/char001.hs +++ /dev/null @@ -1,43 +0,0 @@ --- !!! Testing the behaviour of Char.lexLitChar a little.. - --- [March 2003] We now allow \X and \O as escapes although the --- spec only permits \x and \o. Seems more consistent. - -module Main where - -import Data.Char - -lex' str = do - putStr ("lex " ++ str ++ " = ") - print (lex str) - -hexes = do - lex' "'\\X00'" - lex' "'\\x0f2'" - lex' "'\\xf2'" - lex' "'\\xf2t'" - lex' "'\\X24'" - lex' "'\\x24b'" - lex' "'\\Xa4b'" - lex' "'\\xa4bg'" - -octs = do - lex' "'\\o00'" - lex' "'\\o05'" - lex' "'\\o50'" - lex' "'\\o72'" - lex' "'\\o82'" - lex' "'\\O24'" - lex' "'\\O000024'" - lex' "'\\024b'" - lex' "'\\o14b'" - lex' "'\\0a4bg'" - -main = do - hexes - octs - - - - - diff --git a/testsuite/tests/lib/should_run/char001.stdout b/testsuite/tests/lib/should_run/char001.stdout deleted file mode 100644 index 0c13ac7c03..0000000000 --- a/testsuite/tests/lib/should_run/char001.stdout +++ /dev/null @@ -1,18 +0,0 @@ -lex '\X00' = [("'\\X00'","")] -lex '\x0f2' = [("'\\x0f2'","")] -lex '\xf2' = [("'\\xf2'","")] -lex '\xf2t' = [] -lex '\X24' = [("'\\X24'","")] -lex '\x24b' = [("'\\x24b'","")] -lex '\Xa4b' = [("'\\Xa4b'","")] -lex '\xa4bg' = [] -lex '\o00' = [("'\\o00'","")] -lex '\o05' = [("'\\o05'","")] -lex '\o50' = [("'\\o50'","")] -lex '\o72' = [("'\\o72'","")] -lex '\o82' = [] -lex '\O24' = [("'\\O24'","")] -lex '\O000024' = [("'\\O000024'","")] -lex '\024b' = [] -lex '\o14b' = [] -lex '\0a4bg' = [] diff --git a/testsuite/tests/lib/should_run/char002.hs b/testsuite/tests/lib/should_run/char002.hs deleted file mode 100644 index 60b8b03cda..0000000000 --- a/testsuite/tests/lib/should_run/char002.hs +++ /dev/null @@ -1,7 +0,0 @@ --- !!! tests for large character values in literals -import Data.Char -main = do - print (ord '\xffff') - print (ord '\o7777') - print (ord '\65535') - print (map ord "\xffff\o7777\65535") diff --git a/testsuite/tests/lib/should_run/char002.stdout b/testsuite/tests/lib/should_run/char002.stdout deleted file mode 100644 index 5190ad9c53..0000000000 --- a/testsuite/tests/lib/should_run/char002.stdout +++ /dev/null @@ -1,4 +0,0 @@ -65535 -4095 -65535 -[65535,4095,65535] diff --git a/testsuite/tests/lib/should_run/cstring001.hs b/testsuite/tests/lib/should_run/cstring001.hs deleted file mode 100644 index 38d0d25db2..0000000000 --- a/testsuite/tests/lib/should_run/cstring001.hs +++ /dev/null @@ -1,18 +0,0 @@ -import Control.Monad -import Foreign.C.String - -test_strings = ["Hello World", replicate 10000 'a'] - -assertEqual :: (Eq a, Show a) => a -> a -> IO () -assertEqual x y = if x == y then return () else error $ "assertEqual: " ++ show x ++ " /= " ++ show y - -main = do - -- Try roundtripping some ASCII strings through the locale encoding - forM test_strings $ \try_str -> do - got_str <- withCString try_str peekCString - got_str `assertEqual` try_str - - -- Try roundtripping some ASCII strings with lengths through the locale encoding - forM test_strings $ \try_str -> do - got_str <- withCStringLen try_str peekCStringLen - got_str `assertEqual` try_str diff --git a/testsuite/tests/lib/should_run/dynamic001.hs b/testsuite/tests/lib/should_run/dynamic001.hs deleted file mode 100644 index 7a3fd515e9..0000000000 --- a/testsuite/tests/lib/should_run/dynamic001.hs +++ /dev/null @@ -1,107 +0,0 @@ --- !!! Dynamic library regression tests -module Main(main) where - -import Data.Dynamic - -main :: IO () -main = do - test "toDyn" toDyn_list - testIO "fromDyn" fromDyn_test - -toDyn_list :: [Dynamic] -toDyn_list = - [ toDyn (1::Int) - , toDyn ('a') - , toDyn False - , toDyn ((-1.0)::Float) - , toDyn (0.0::Double) - , toDyn (1394::Integer) - , toDyn (print "hello") - , toDyn toDyn_list - , toDyn ([]::[Int]) - , toDyn (Nothing :: Maybe Int) - , toDyn ((Just 2) :: Maybe Int) - , toDyn ((Just 2) :: Maybe Int) - , toDyn ((Left 3) :: Either Int Bool) - , toDyn ((Right 3) :: Either Char Int) - , toDyn () - , toDyn LT - , toDyn ((),2::Int) - , toDyn ((),2::Int,'a') - , toDyn ((),2::Int,'a',1.0::Double) - , toDyn ((),2::Int,'a',1.0::Double,Nothing::Maybe Bool) - , toDyn ((+) :: Int -> Int -> Int) - , toDyn ((+) :: Integer -> Integer -> Integer) - , toDyn ((++) :: [Char] -> [Char] -> [Char]) - ] - --- Testing the conversion from Dynamic values: -fromDyn_test :: IO () -fromDyn_test = do - print (fromDyn (toDyn (1::Int)) (0::Int)) - print (fromDyn (toDyn ('a'::Char)) (0::Int)) - print (fromDyn (toDyn 'a') 'b') - print (fromDyn (toDyn (1::Float)) (0::Float)) - print (fromDyn (toDyn (2::Float)) (0::Int)) - print (fromDyn (toDyn (3::Double)) (0::Double)) - print (fromDyn (toDyn (4::Double)) (0::Int)) - print (fromDyn (toDyn (5::Integer)) (0::Integer)) - print (fromDyn (toDyn (6::Integer)) False) - print (fromDyn (toDyn [1,3,5::Integer]) ([]::[Integer])) - print (fromDyn (toDyn (Just True)) (Nothing::Maybe Bool)) - print (fromDyn (toDyn (Left True::Either Bool Bool)) (Right False :: Either Bool Bool)) - print (fromDyn (toDyn LT) GT) - print (fromDyn (toDyn ((+1)::Int->Int)) False) - print ((fromDyn (toDyn ((+1)::Int->Int)) ((+2)::Int->Int)) 3) - print ((fromDyn (toDyn ((++)::[Int]->[Int]->[Int])) ((undefined)::[Int]->[Int]->[Int])) [1] [2]) - - --- Misc test utilities: -test :: Show a => String -> [a] -> IO () -test str ls = do - putStrLn ("*** Testing: " ++ str ++ " ***") - putStrLn (showListLn ls) - -testIO :: String -> IO () -> IO () -testIO str tst = do - putStrLn ("*** Testing: " ++ str ++ " ***") - tst - - --- showListLn presents a list in a diff-friendly format. --- showListLn [a1,..an] --- => --- [ a1 --- , a2 --- .. --- , an --- ] --- -showListLn :: Show a => [a] -> String -showListLn [] = "" -showListLn ls = '[' : ' ' : go ls - where - go [x] = show x ++ "\n]" - go (x:xs) = show x ++ '\n':',':' ':go xs - -{- -test8 = toDyn (mkAppTy listTc) -test9 :: Float -test9 = fromDyn test8 0 - -printf :: String -> [Dynamic] -> IO () -printf str args = putStr (decode str args) - where - decode [] [] = [] - decode ('%':'n':cs) (d:ds) = - (\ v -> show v++decode cs ds) (fromDyn d (0::Int)) - decode ('%':'c':cs) (d:ds) = - (\ v -> show v++decode cs ds) (fromDyn d ('\0')) - decode ('%':'b':cs) (d:ds) = - (\ v -> show v++decode cs ds) (fromDyn d (False::Bool)) - decode (x:xs) ds = x:decode xs ds - -test10 :: IO () -test10 = printf "%n = %c, that much is %b\n" [toDyn (3::Int),toDyn 'a', toDyn False] - --} diff --git a/testsuite/tests/lib/should_run/dynamic001.stdout b/testsuite/tests/lib/should_run/dynamic001.stdout deleted file mode 100644 index c2d365a7c6..0000000000 --- a/testsuite/tests/lib/should_run/dynamic001.stdout +++ /dev/null @@ -1,42 +0,0 @@ -*** Testing: toDyn *** -[ <<Int>> -, <<Char>> -, <<Bool>> -, <<Float>> -, <<Double>> -, <<Integer>> -, <<IO ()>> -, <<[Dynamic]>> -, <<[Int]>> -, <<Maybe Int>> -, <<Maybe Int>> -, <<Maybe Int>> -, <<Either Int Bool>> -, <<Either Char Int>> -, <<()>> -, <<Ordering>> -, <<((),Int)>> -, <<((),Int,Char)>> -, <<((),Int,Char,Double)>> -, <<((),Int,Char,Double,(Maybe Bool))>> -, <<Int -> Int -> Int>> -, <<Integer -> Integer -> Integer>> -, <<[Char] -> [Char] -> [Char]>> -] -*** Testing: fromDyn *** -1 -0 -'a' -1.0 -0 -3.0 -0 -5 -False -[1,3,5] -Just True -Left True -LT -False -4 -[1,2] diff --git a/testsuite/tests/lib/should_run/dynamic002.hs b/testsuite/tests/lib/should_run/dynamic002.hs deleted file mode 100644 index 6d53d2ed1e..0000000000 --- a/testsuite/tests/lib/should_run/dynamic002.hs +++ /dev/null @@ -1,91 +0,0 @@ --- !!! Testing Typeable instances -module Main(main) where - -import Data.Dynamic -import Data.Array -import Data.Array.MArray -import Data.Array.ST -import Data.Array.IO -import Data.Array.Unboxed -import Data.Complex -import Data.Int -import Data.Word -import Data.IORef -import System.IO -import Control.Monad.ST -import System.Mem.StableName -import System.Mem.Weak -import Foreign.StablePtr -import Control.Exception -import Foreign.C.Types - -main :: IO () -main = do - print (typeOf (undefined :: [()])) - print (typeOf (undefined :: ())) - print (typeOf (undefined :: ((),()))) - print (typeOf (undefined :: ((),(),()))) - print (typeOf (undefined :: ((),(),(),()))) - print (typeOf (undefined :: ((),(),(),(),()))) - print (typeOf (undefined :: (() -> ()))) - print (typeOf (undefined :: (Array () ()))) - print (typeOf (undefined :: Bool)) - print (typeOf (undefined :: Char)) - print (typeOf (undefined :: (Complex ()))) - print (typeOf (undefined :: Double)) - print (typeOf (undefined :: (Either () ()))) - print (typeOf (undefined :: Float)) - print (typeOf (undefined :: Handle)) - print (typeOf (undefined :: Int)) - print (typeOf (undefined :: Integer)) - print (typeOf (undefined :: IO ())) - print (typeOf (undefined :: (Maybe ()))) - print (typeOf (undefined :: Ordering)) - - print (typeOf (undefined :: Dynamic)) - print (typeOf (undefined :: (IORef ()))) - print (typeOf (undefined :: Int8)) - print (typeOf (undefined :: Int16)) - print (typeOf (undefined :: Int32)) - print (typeOf (undefined :: Int64)) - print (typeOf (undefined :: (ST () ()))) - print (typeOf (undefined :: (StableName ()))) - print (typeOf (undefined :: (StablePtr ()))) - print (typeOf (undefined :: TyCon)) - print (typeOf (undefined :: TypeRep)) - print (typeOf (undefined :: Word8)) - print (typeOf (undefined :: Word16)) - print (typeOf (undefined :: Word32)) - print (typeOf (undefined :: Word64)) - - print (typeOf (undefined :: ArithException)) - print (typeOf (undefined :: AsyncException)) - print (typeOf (undefined :: (IOArray () ()))) - print (typeOf (undefined :: (IOUArray () ()))) - print (typeOf (undefined :: (STArray () () ()))) - print (typeOf (undefined :: (STUArray () () ()))) - print (typeOf (undefined :: (StableName ()))) - print (typeOf (undefined :: (StablePtr ()))) - print (typeOf (undefined :: (UArray () ()))) - print (typeOf (undefined :: (Weak ()))) - - print (typeOf (undefined :: CChar)) - print (typeOf (undefined :: CSChar)) - print (typeOf (undefined :: CUChar)) - print (typeOf (undefined :: CShort)) - print (typeOf (undefined :: CUShort)) - print (typeOf (undefined :: CInt)) - print (typeOf (undefined :: CUInt)) - print (typeOf (undefined :: CLong)) - print (typeOf (undefined :: CULong)) - print (typeOf (undefined :: CLLong)) - print (typeOf (undefined :: CULLong)) - print (typeOf (undefined :: CFloat)) - print (typeOf (undefined :: CDouble)) - - print (typeOf (undefined :: CPtrdiff)) - print (typeOf (undefined :: CSize)) - print (typeOf (undefined :: CWchar)) - print (typeOf (undefined :: CSigAtomic)) - print (typeOf (undefined :: CClock)) - print (typeOf (undefined :: CTime)) diff --git a/testsuite/tests/lib/should_run/dynamic002.stdout b/testsuite/tests/lib/should_run/dynamic002.stdout deleted file mode 100644 index 8b55566ada..0000000000 --- a/testsuite/tests/lib/should_run/dynamic002.stdout +++ /dev/null @@ -1,64 +0,0 @@ -[()] -() -((),()) -((),(),()) -((),(),(),()) -((),(),(),(),()) -() -> () -Array () () -Bool -Char -Complex () -Double -Either () () -Float -Handle -Int -Integer -IO () -Maybe () -Ordering -Dynamic -IORef () -Int8 -Int16 -Int32 -Int64 -ST () () -StableName () -StablePtr () -TyCon -TypeRep -Word8 -Word16 -Word32 -Word64 -ArithException -AsyncException -IOArray () () -IOUArray () () -STArray () () () -STUArray () () () -StableName () -StablePtr () -UArray () () -Weak () -CChar -CSChar -CUChar -CShort -CUShort -CInt -CUInt -CLong -CULong -CLLong -CULLong -CFloat -CDouble -CPtrdiff -CSize -CWchar -CSigAtomic -CClock -CTime diff --git a/testsuite/tests/lib/should_run/dynamic003.hs b/testsuite/tests/lib/should_run/dynamic003.hs deleted file mode 100644 index fae8bdb276..0000000000 --- a/testsuite/tests/lib/should_run/dynamic003.hs +++ /dev/null @@ -1,12 +0,0 @@ -module Main where - --- Test generation of large TypeReps --- (can be used as a benchmark) - -import Data.Typeable - -f :: Typeable a => Int -> a -> TypeRep -f 0 a = typeOf a -f n a = f (n-1) [a] - -main = print (f 50000 () == f 50001 ()) diff --git a/testsuite/tests/lib/should_run/dynamic003.stdout b/testsuite/tests/lib/should_run/dynamic003.stdout deleted file mode 100644 index bc59c12aa1..0000000000 --- a/testsuite/tests/lib/should_run/dynamic003.stdout +++ /dev/null @@ -1 +0,0 @@ -False diff --git a/testsuite/tests/lib/should_run/dynamic004.hs b/testsuite/tests/lib/should_run/dynamic004.hs deleted file mode 100644 index e6b7a82bfd..0000000000 --- a/testsuite/tests/lib/should_run/dynamic004.hs +++ /dev/null @@ -1,36 +0,0 @@ -module Main where - -import Data.Typeable -import Data.Typeable.Internal -import GHC.Fingerprint -import Text.Printf - -f :: Typeable a => Int -> a -> [TypeRep] -f 0 a = [] -f n a = typeOf a : f (n-1) [a] - --- pointwise compare 1000x1001 TypeReps, there should be exactly 1000 equalities --- (can be used as a benchmark) -main = print $ length [ t1 | t1 <- f 1000 (), t2 <- f 1001 (), t1 == t2 ] - -{- - DEBUGGING code to help find bugs in the TypeRep implementation when - this test fails: - - where - g (x:xs) (y:ys) - | x == y = g xs ys - | otherwise = do - print x - case x of - TypeRep f1 (TyCon f2 _ _ _) [TypeRep f3 _ _] -> - printf "f1: %s\nf2: %s\nf3: %s\n" (show_fp f1) (show_fp f2) (show_fp f3) - case y of - TypeRep f1 (TyCon f2 _ _ _) [TypeRep f3 _ _] -> - printf "f1: %s\nf2: %s\nf3: %s\n" (show_fp f1) (show_fp f2) (show_fp f3) - g _ _ = return () - - show_fp :: Fingerprint -> String - show_fp (Fingerprint h l) = - printf "%x %x" h l --} diff --git a/testsuite/tests/lib/should_run/dynamic004.stdout b/testsuite/tests/lib/should_run/dynamic004.stdout deleted file mode 100644 index 83b33d238d..0000000000 --- a/testsuite/tests/lib/should_run/dynamic004.stdout +++ /dev/null @@ -1 +0,0 @@ -1000 diff --git a/testsuite/tests/lib/should_run/dynamic005.hs b/testsuite/tests/lib/should_run/dynamic005.hs deleted file mode 100644 index e90aeea960..0000000000 --- a/testsuite/tests/lib/should_run/dynamic005.hs +++ /dev/null @@ -1,14 +0,0 @@ -module Main where - -import Data.Typeable - -f :: Typeable a => Int -> a -> [TypeRep] -f 0 a = [] -f n a = typeOf a : f (n-1) [a] - --- pointwise compare 1000x1000 different TypeReps, there should be no equalities --- (can be used as a benchmark) - -main = print $ length [ t1 | t1 <- replicate 1000 (f 10 ()), - t2 <- replicate 1000 (f 10 'a'), - t1 == t2 ] diff --git a/testsuite/tests/lib/should_run/dynamic005.stdout b/testsuite/tests/lib/should_run/dynamic005.stdout deleted file mode 100644 index 573541ac97..0000000000 --- a/testsuite/tests/lib/should_run/dynamic005.stdout +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/testsuite/tests/lib/should_run/enum01.hs b/testsuite/tests/lib/should_run/enum01.hs deleted file mode 100644 index d8178667eb..0000000000 --- a/testsuite/tests/lib/should_run/enum01.hs +++ /dev/null @@ -1,526 +0,0 @@ --- !!! Testing the Prelude's Enum instances. -module Main(main) where - -import Control.Exception -import Prelude hiding (catch) -import Data.Char -import Data.Ratio - -main = do - -- Enum Int - putStrLn "Testing Enum Int: " - testEnumInt - -- Enum Integer - putStrLn "Testing Enum Integer: " - testEnumInteger - -- Enum Char - putStrLn "Testing Enum Char: " - testEnumChar - -- Enum () - putStrLn "Testing Enum (): " - testEnumUnit - -- Enum Ordering - putStrLn "Testing Enum Ordering (derived): " - testEnumOrdering - -- Enum Bool - putStrLn "Testing Enum Bool: " - testEnumBool - -- Enum Rational - putStrLn "Testing Enum Rational: " - testEnumRational - -- Enum (Ratio Int) - putStrLn "Testing Enum (Ratio Int): " - testEnumRatioInt - -{- - Here's the properties that's supposed to - hold for arithmetic sequences over Int: - - - [e1..] = [e1, (e1+1), (e1+2), ..., maxBound] - - - [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.) - - [e1..e3] = [e1, (e1+i), (e1+2*i),..e3] - where - 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] - - Note: - (*) - I think this instead should be (i < 0 && e3 > e1), since, as is, - - [x,(x+1) ..x] = [x] - [x,(x-1) ..x] = [] - - which does not look right, symmetrically speaking. - - - 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 - i.) - - Q - does [(x::Double)..] have an upper bound? (ditto for Float.) - - OK - on with the regression testing. --} - -#define printTest(x) (do{ putStr ( " " ++ "x" ++ " = " ) ; print (x) }) - - -testEnumInt :: IO () -testEnumInt = do - -- succ - printTest ((succ (0::Int))) - printTest ((succ (minBound::Int))) - mayBomb (printTest ((succ (maxBound::Int)))) - - -- pred - printTest (pred (1::Int)) - printTest (pred (maxBound::Int)) - mayBomb (printTest (pred (minBound::Int))) - - -- toEnum - printTest ((map (toEnum::Int->Int) [1,minBound,maxBound])) - - -- fromEnum - printTest ((map fromEnum [(1::Int),minBound,maxBound])) - - -- [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..])) - printTest ((take 7 [(1::Int),1..])) - printTest ((take 7 [(1::Int),0..])) - printTest ((take 7 [(5::Int),2..])) - let x = (minBound::Int) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Int) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Int) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- Test overflow conditions - printTest (([minBound::Int,1..])) - printTest (([minBound::Int,0..])) - printTest (([minBound::Int,-1..])) - printTest (([maxBound::Int,1..])) - printTest (([maxBound::Int,0..])) - printTest (([maxBound::Int,-1..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Int) .. 5]))) - printTest ((take 4 ([(1::Int) .. 1]))) - printTest ((take 7 ([(1::Int) .. 0]))) - printTest ((take 7 ([(5::Int) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Int)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Int)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Int),4..1])) - printTest ((take 7 [(5::Int),3..1])) - printTest ((take 7 [(5::Int),3..2])) - printTest ((take 7 [(1::Int),2..1])) - printTest ((take 7 [(2::Int),1..2])) - printTest ((take 7 [(2::Int),1..1])) - printTest ((take 7 [(2::Int),3..1])) - - -- Test overflow conditions - printTest (([minBound, 1..maxBound::Int])) - printTest (([minBound, 0..maxBound::Int])) - printTest (([minBound,-1..maxBound::Int])) - printTest (([minBound,-1..maxBound-1::Int])) - printTest (([minBound,-1..maxBound-2::Int])) - - printTest (([maxBound, 1..minBound::Int])) - printTest (([maxBound, 0..minBound::Int])) - printTest (([maxBound, 0..minBound+1::Int])) - printTest (([maxBound, 0..minBound+2::Int])) - printTest (([maxBound,-1..minBound::Int])) - - let x = (maxBound::Int) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Int) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - -testEnumChar :: IO () -testEnumChar = do - -- succ - printTest ((succ 'a')) - printTest ((succ (minBound::Char))) - mayBomb (printTest ((succ (maxBound::Char)))) - - -- pred - printTest ((pred 'b')) - printTest (pred (maxBound::Char)) - mayBomb (printTest (pred (minBound::Char))) - - -- toEnum - printTest ((map (toEnum::Int->Char) [123,ord (minBound::Char), ord(maxBound::Char)])) - mayBomb (printTest ((toEnum::Int->Char) (minBound::Int))) - - -- fromEnum - printTest ((map fromEnum ['X',minBound,maxBound])) - - -- [x..] aka enumFrom - -- printTest ((take 7 ['\NUL' .. ])) - 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'..])) - printTest ((take 7 ['a','a'..])) - printTest ((take 7 ['z','y'..])) - printTest ((take 7 ['z','v'..])) - let x = '\1' - -- printTest ((take 7 ['\1', '\0' ..])) - do{ putStr ( " " ++ "(take 7 ['\\1', '\\0' ..])" ++ " = " ) ; print (take 7 ['\1', '\0' ..]) } - let x = '\5' - -- printTest ((take 7 ['\5', '\4' ..])) - do{ putStr ( " " ++ "(take 7 ['\\5', '\\4' ..])" ++ " = " ) ; print (take 7 ['\5', '\4' ..]) } - let x = (maxBound::Int) - 5 - -- printTest ((take 7 ['\250', '\251' ..])) - do{ putStr ( " " ++ "(take 7 ['\\250', '\\251' ..])" ++ " = " ) ; print (take 7 ['\250', '\251' ..]) } - - -- [x..y] aka enumFromTo - printTest ((take 7 (['a' .. 'e']))) - printTest ((take 4 (['a' .. 'a']))) - printTest ((take 7 (['b' .. 'a']))) - printTest ((take 7 (['e' .. 'a']))) - -- printTest ((take 7 (['\250' .. '\255']))) - do{ putStr ( " " ++ "(take 7 (['\\250' .. '\\255']))" ++ " = " ) ; print (take 7 (['\250' .. '\255'])) } - -- printTest ((take 7 (['\5' .. '\0']))) - do{ putStr ( " " ++ "(take 7 (['\\5' .. '\\0']))" ++ " = " ) ; print (take 7 (['\5' .. '\0'])) } - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 ['f','e' .. 'b'])) - printTest ((take 7 ['g','e' .. 'b'])) - printTest ((take 7 ['g','d' .. 'c'])) - printTest ((take 7 ['b','c' .. 'b'])) - printTest ((take 7 ['c','b' .. 'c'])) - printTest ((take 7 ['c','b' .. 'b'])) - printTest ((take 7 ['c','d' .. 'b'])) - -- printTest ((take 7 ['\251', '\252' .. maxBound])) - do{ putStr ( " " ++ "(take 7 ['\\251', '\\252' .. maxBound])" ++ " = " ) ; print (take 7 ['\251', '\252' .. maxBound]) } - -- printTest ((take 7 ['\5', '\4' .. minBound])) - do{ putStr ( " " ++ "(take 7 ['\\5', '\\4' .. minBound])" ++ " = " ) ; print (take 7 ['\5', '\4' .. minBound]) } - - -testEnumUnit :: IO () -testEnumUnit = do - -- succ: - mayBomb (printTest ((succ ()))) - mayBomb (printTest ((succ (minBound::())))) - mayBomb (printTest ((succ (maxBound::())))) - - -- pred: - mayBomb (printTest ((pred ()))) - mayBomb (printTest ((pred (minBound::())))) - mayBomb (printTest ((pred (maxBound::())))) - - -- toEnum: - printTest ((toEnum 0)::()) - mayBomb (printTest ((toEnum 1)::())) - - -- fromEnum: - printTest ((fromEnum ())) - - -- enumFrom: - printTest ((take 7 [()..])) - - -- enumFromThen: - printTest ((take 7 [(),()..])) - - -- enumFromTo - printTest ((take 7 [()..()])) - - -- enumFromThenTo - printTest ((take 7 [(),()..()])) - -testEnumOrdering :: IO () -testEnumOrdering = do - -- succ: - printTest ((succ LT)) - printTest ((succ (minBound::Ordering))) - mayBomb (printTest ((succ (maxBound::Ordering)))) - - -- pred: - printTest ((pred GT)) - printTest ((pred (maxBound::Ordering))) - mayBomb (printTest ((pred (minBound::Ordering)))) - - -- toEnum: - printTest ((toEnum 0)::Ordering) - mayBomb (printTest ((toEnum 5)::Ordering)) - - -- fromEnum: - printTest ((fromEnum LT)) - printTest ((fromEnum EQ)) - printTest ((fromEnum GT)) - - -- enumFrom: - printTest (([LT ..])) - printTest (([EQ ..])) - printTest (([GT ..])) - - -- enumFromThen: - printTest (([LT,EQ ..])) - printTest (([EQ,GT ..])) - printTest (([EQ,LT ..])) - printTest (([LT,GT ..])) - printTest (([GT,LT ..])) - printTest (take 7 (([GT,GT ..]))) - printTest (take 7 (([LT,LT ..]))) - - -- enumFromTo - printTest (([LT .. GT])) - printTest (([LT .. EQ])) - printTest (([LT .. LT])) - printTest (([GT .. LT])) - printTest (([GT .. EQ])) - printTest (([GT .. GT])) - - -- enumFromThenTo - printTest (([LT,EQ .. GT])) - printTest (([GT,EQ .. LT])) - printTest (([GT,EQ .. EQ])) - printTest (([GT,EQ .. GT])) - printTest (([GT,EQ .. LT])) - printTest (([LT,EQ .. LT])) - printTest (([LT,EQ .. GT])) - printTest (take 7 (([LT,LT .. GT]))) - printTest (take 7 (([GT,GT .. LT]))) - -testEnumBool :: IO () -testEnumBool = do - -- succ: - printTest ((succ False)) - printTest ((succ (minBound::Bool))) - mayBomb (printTest ((succ (maxBound::Bool)))) - - -- pred: - printTest ((pred True)) - printTest ((pred (maxBound::Bool))) - mayBomb (printTest ((pred (minBound::Bool)))) - - -- toEnum: - printTest ((toEnum 0)::Bool) - mayBomb (printTest ((toEnum 5)::Bool)) - - -- fromEnum: - printTest ((fromEnum False)) - printTest ((fromEnum True)) - - -- enumFrom: - printTest (([False ..])) - printTest (([True ..])) - - -- enumFromThen: - printTest (([False,True ..])) - printTest (([True,False ..])) - printTest ((take 7 ([False,False ..]))) - printTest ((take 7 ([True,True ..]))) - - -- enumFromTo - printTest (([False .. True])) - printTest (([True .. False])) - - -- enumFromThenTo - printTest (take 7 ([False,False .. False])) - printTest (take 7 ([False,False .. True])) - printTest (take 7 ([False,True .. False])) - printTest (take 7 ([False,True .. True])) - printTest (take 7 ([True,False .. False])) - printTest (take 7 ([True,False .. True])) - printTest (take 7 ([True,True .. False])) - printTest (take 7 ([True,True .. True])) - - -testEnumInteger :: IO () -testEnumInteger = do - -- succ - printTest ((succ (0::Integer))) - printTest ((succ ((-1)::Integer))) - - -- pred - printTest (pred (1::Integer)) - printTest (pred (0::Integer)) - - -- toEnum - printTest ((map (toEnum::Int->Integer) [1,minBound,maxBound])) - - -- fromEnum - printTest ((map fromEnum [(1::Integer),42,45])) - - -- [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..])) - printTest ((take 7 [(1::Integer),1..])) - printTest ((take 7 [(1::Integer),0..])) - printTest ((take 7 [(5::Integer),2..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Integer) .. 5]))) - printTest ((take 4 ([(1::Integer) .. 1]))) - printTest ((take 7 ([(1::Integer) .. 0]))) - printTest ((take 7 ([(5::Integer) .. 0]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Integer),4..1])) - printTest ((take 7 [(5::Integer),3..1])) - printTest ((take 7 [(5::Integer),3..2])) - printTest ((take 7 [(1::Integer),2..1])) - printTest ((take 7 [(2::Integer),1..2])) - printTest ((take 7 [(2::Integer),1..1])) - printTest ((take 7 [(2::Integer),3..1])) - -testEnumRational :: IO () -testEnumRational = do - -- succ - printTest ((succ (0::Rational))) - printTest ((succ ((-1)::Rational))) - - -- pred - printTest (pred (1::Rational)) - printTest (pred (0::Rational)) - - -- toEnum - printTest ((map (toEnum::Int->Rational) [1,minBound,maxBound])) - - -- fromEnum - printTest ((map fromEnum [(1::Rational),42,45])) - - -- [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..])) - printTest ((take 7 [(1::Rational),1..])) - printTest ((take 7 [(1::Rational),0..])) - printTest ((take 7 [(5::Rational),2..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Rational) .. 5]))) - printTest ((take 4 ([(1::Rational) .. 1]))) - printTest ((take 7 ([(1::Rational) .. 0]))) - printTest ((take 7 ([(5::Rational) .. 0]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Rational),4..1])) - printTest ((take 7 [(5::Rational),3..1])) - printTest ((take 7 [(5::Rational),3..2])) - printTest ((take 7 [(1::Rational),2..1])) - printTest ((take 7 [(2::Rational),1..2])) - printTest ((take 7 [(2::Rational),1..1])) - printTest ((take 7 [(2::Rational),3..1])) - -testEnumRatioInt :: IO () -testEnumRatioInt = do - -- succ - printTest ((succ (0::Ratio Int))) - printTest ((succ ((-1)::Ratio Int))) - - -- pred - printTest (pred (1::Ratio Int)) - printTest (pred (0::Ratio Int)) - - -- toEnum - printTest ((map (toEnum::Int->Ratio Int) [1,minBound,maxBound])) - - -- fromEnum - printTest ((map fromEnum [(1::Ratio Int),42,45])) - - -- [x..] aka enumFrom - 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..])) - printTest ((take 7 [(1::Ratio Int),1..])) - printTest ((take 7 [(1::Ratio Int),0..])) - printTest ((take 7 [(5::Ratio Int),2..])) - let x = (toEnum ((minBound::Int) + 1))::Ratio Int - printTest ((take 7 [x, x-1 ..])) - let x = (toEnum ((minBound::Int) + 5))::Ratio Int - printTest ((take 7 [x, x-1 ..])) - let x = (toEnum ((maxBound::Int) - 5))::Ratio Int - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Ratio Int) .. 5]))) - printTest ((take 4 ([(1::Ratio Int) .. 1]))) - printTest ((take 7 ([(1::Ratio Int) .. 0]))) - printTest ((take 7 ([(5::Ratio Int) .. 0]))) - let x = (toEnum (maxBound - (5::Int))) :: Ratio Int - let y = (toEnum (maxBound::Int)) :: Ratio Int - printTest ((take 7 ([x..y]))) - let x = (toEnum (minBound + (5::Int))) :: Ratio Int - let y = (toEnum (minBound::Int)) :: Ratio Int - printTest ((take 7 ([x..y]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Ratio Int),4..1])) - printTest ((take 7 [(5::Ratio Int),3..1])) - printTest ((take 7 [(5::Ratio Int),3..2])) - printTest ((take 7 [(1::Ratio Int),2..1])) - printTest ((take 7 [(2::Ratio Int),1..2])) - printTest ((take 7 [(2::Ratio Int),1..1])) - printTest ((take 7 [(2::Ratio Int),3..1])) - - let x = (toEnum ((maxBound::Int) - 4)) :: Ratio Int - let y = (toEnum (maxBound::Int)) :: Ratio Int - printTest ((take 7 [x,(x+1)..y])) - let x = (toEnum ((minBound::Int) + 5)) :: Ratio Int - let y = (toEnum (minBound::Int)) :: Ratio Int - printTest ((take 7 [x,(x-1)..y])) - --- --- --- Utils --- --- - - -mayBomb x = catch x (\(ErrorCall e) -> putStrLn ("error " ++ show e)) - `catch` (\e -> putStrLn ("Fail: " ++ show (e :: SomeException))) - -test :: Show a => String -> String -> a -> IO () -test test_nm expected val = do - putStr test_nm - if expected == got then - putStrLn ": SUCCEEDED" - else do - putStr ": FAILED" - putStrLn ("( expected: " ++ show expected ++ " , got: " ++ show got ++ " )") - where - got = show val diff --git a/testsuite/tests/lib/should_run/enum01.stdout b/testsuite/tests/lib/should_run/enum01.stdout deleted file mode 100644 index 71e5bd6d1a..0000000000 --- a/testsuite/tests/lib/should_run/enum01.stdout +++ /dev/null @@ -1,246 +0,0 @@ -Testing Enum Int: - (succ (0::Int)) = 1 - (succ (minBound::Int)) = -2147483647 - (succ (maxBound::Int)) = error "Prelude.Enum.succ{Int}: tried to take `succ' of maxBound" - pred (1::Int) = 0 - pred (maxBound::Int) = 2147483646 - pred (minBound::Int) = error "Prelude.Enum.pred{Int}: tried to take `pred' of minBound" - (map (toEnum::Int->Int) [1,minBound,maxBound]) = [1,-2147483648,2147483647] - (map fromEnum [(1::Int),minBound,maxBound]) = [1,-2147483648,2147483647] - (take 7 [(1::Int)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int)-5)..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [(1::Int),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-2147483647,-2147483648] - (take 7 [x, x-1 ..]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] - (take 7 [x, (x+1) ..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - ([minBound::Int,1..]) = [-2147483648,1] - ([minBound::Int,0..]) = [-2147483648,0] - ([minBound::Int,-1..]) = [-2147483648,-1,2147483646] - ([maxBound::Int,1..]) = [2147483647,1,-2147483645] - ([maxBound::Int,0..]) = [2147483647,0,-2147483647] - ([maxBound::Int,-1..]) = [2147483647,-1] - (take 7 ([(1::Int) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int) .. 1])) = [1] - (take 7 ([(1::Int) .. 0])) = [] - (take 7 ([(5::Int) .. 0])) = [] - (take 7 ([(maxBound-(5::Int)) .. maxBound])) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(minBound+(5::Int)) .. minBound])) = [] - (take 7 [(5::Int),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int),3..1]) = [5,3,1] - (take 7 [(5::Int),3..2]) = [5,3] - (take 7 [(1::Int),2..1]) = [1] - (take 7 [(2::Int),1..2]) = [2] - (take 7 [(2::Int),1..1]) = [2,1] - (take 7 [(2::Int),3..1]) = [] - ([minBound, 1..maxBound::Int]) = [-2147483648,1] - ([minBound, 0..maxBound::Int]) = [-2147483648,0] - ([minBound,-1..maxBound::Int]) = [-2147483648,-1,2147483646] - ([minBound,-1..maxBound-1::Int]) = [-2147483648,-1,2147483646] - ([minBound,-1..maxBound-2::Int]) = [-2147483648,-1] - ([maxBound, 1..minBound::Int]) = [2147483647,1,-2147483645] - ([maxBound, 0..minBound::Int]) = [2147483647,0,-2147483647] - ([maxBound, 0..minBound+1::Int]) = [2147483647,0,-2147483647] - ([maxBound, 0..minBound+2::Int]) = [2147483647,0] - ([maxBound,-1..minBound::Int]) = [2147483647,-1] - (take 7 [x,(x+1)..maxBound]) = [2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [x,(x-1)..minBound]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] -Testing Enum Integer: - (succ (0::Integer)) = 1 - (succ ((-1)::Integer)) = 0 - pred (1::Integer) = 0 - pred (0::Integer) = -1 - (map (toEnum::Int->Integer) [1,minBound,maxBound]) = [1,-2147483648,2147483647] - (map fromEnum [(1::Integer),42,45]) = [1,42,45] - (take 7 [(1::Integer)..]) = [1,2,3,4,5,6,7] - (take 7 [(-5::Integer)..]) = [-5,-4,-3,-2,-1,0,1] - (take 7 [(1::Integer),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Integer),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Integer),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Integer),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Integer),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 ([(1::Integer) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Integer) .. 1])) = [1] - (take 7 ([(1::Integer) .. 0])) = [] - (take 7 ([(5::Integer) .. 0])) = [] - (take 7 [(5::Integer),4..1]) = [5,4,3,2,1] - (take 7 [(5::Integer),3..1]) = [5,3,1] - (take 7 [(5::Integer),3..2]) = [5,3] - (take 7 [(1::Integer),2..1]) = [1] - (take 7 [(2::Integer),1..2]) = [2] - (take 7 [(2::Integer),1..1]) = [2,1] - (take 7 [(2::Integer),3..1]) = [] -Testing Enum Char: - (succ 'a') = 'b' - (succ (minBound::Char)) = '\SOH' - (succ (maxBound::Char)) = error "Prelude.Enum.Char.succ: bad argument" - (pred 'b') = 'a' - pred (maxBound::Char) = '\1114110' - pred (minBound::Char) = error "Prelude.Enum.Char.pred: bad argument" - (map (toEnum::Int->Char) [123,ord (minBound::Char), ord(maxBound::Char)]) = "{\NUL\1114111" - (toEnum::Int->Char) (minBound::Int) = error "Prelude.chr: bad argument: (-2147483648)" - (map fromEnum ['X',minBound,maxBound]) = [88,0,1114111] - (take 7 ['\NUL' .. ]) = "\NUL\SOH\STX\ETX\EOT\ENQ\ACK" - (take 7 ['\250' .. ]) = "\250\251\252\253\254\255\256" - (take 7 ['a','b'..]) = "abcdefg" - (take 7 ['a','e'..]) = "aeimquy" - (take 7 ['a','a'..]) = "aaaaaaa" - (take 7 ['z','y'..]) = "zyxwvut" - (take 7 ['z','v'..]) = "zvrnjfb" - (take 7 ['\1', '\0' ..]) = "\SOH\NUL" - (take 7 ['\5', '\4' ..]) = "\ENQ\EOT\ETX\STX\SOH\NUL" - (take 7 ['\250', '\251' ..]) = "\250\251\252\253\254\255\256" - (take 7 (['a' .. 'e'])) = "abcde" - (take 4 (['a' .. 'a'])) = "a" - (take 7 (['b' .. 'a'])) = "" - (take 7 (['e' .. 'a'])) = "" - (take 7 (['\250' .. '\255'])) = "\250\251\252\253\254\255" - (take 7 (['\5' .. '\0'])) = "" - (take 7 ['f','e' .. 'b']) = "fedcb" - (take 7 ['g','e' .. 'b']) = "gec" - (take 7 ['g','d' .. 'c']) = "gd" - (take 7 ['b','c' .. 'b']) = "b" - (take 7 ['c','b' .. 'c']) = "c" - (take 7 ['c','b' .. 'b']) = "cb" - (take 7 ['c','d' .. 'b']) = "" - (take 7 ['\251', '\252' .. maxBound]) = "\251\252\253\254\255\256\257" - (take 7 ['\5', '\4' .. minBound]) = "\ENQ\EOT\ETX\STX\SOH\NUL" -Testing Enum (): - (succ ()) = error "Prelude.Enum.().succ: bad argument" - (succ (minBound::())) = error "Prelude.Enum.().succ: bad argument" - (succ (maxBound::())) = error "Prelude.Enum.().succ: bad argument" - (pred ()) = error "Prelude.Enum.().pred: bad argument" - (pred (minBound::())) = error "Prelude.Enum.().pred: bad argument" - (pred (maxBound::())) = error "Prelude.Enum.().pred: bad argument" - (toEnum 0)::() = () - (toEnum 1)::() = error "Prelude.Enum.().toEnum: bad argument" - (fromEnum ()) = 0 - (take 7 [()..]) = [()] - (take 7 [(),()..]) = [(),(),(),(),(),(),()] - (take 7 [()..()]) = [()] - (take 7 [(),()..()]) = [(),(),(),(),(),(),()] -Testing Enum Ordering (derived): - (succ LT) = EQ - (succ (minBound::Ordering)) = EQ - (succ (maxBound::Ordering)) = error "Prelude.Enum.Ordering.succ: bad argument" - (pred GT) = EQ - (pred (maxBound::Ordering)) = EQ - (pred (minBound::Ordering)) = error "Prelude.Enum.Ordering.pred: bad argument" - (toEnum 0)::Ordering = LT - (toEnum 5)::Ordering = error "Prelude.Enum.Ordering.toEnum: bad argument" - (fromEnum LT) = 0 - (fromEnum EQ) = 1 - (fromEnum GT) = 2 - ([LT ..]) = [LT,EQ,GT] - ([EQ ..]) = [EQ,GT] - ([GT ..]) = [GT] - ([LT,EQ ..]) = [LT,EQ,GT] - ([EQ,GT ..]) = [EQ,GT] - ([EQ,LT ..]) = [EQ,LT] - ([LT,GT ..]) = [LT,GT] - ([GT,LT ..]) = [GT,LT] - take 7 (([GT,GT ..])) = [GT,GT,GT,GT,GT,GT,GT] - take 7 (([LT,LT ..])) = [LT,LT,LT,LT,LT,LT,LT] - ([LT .. GT]) = [LT,EQ,GT] - ([LT .. EQ]) = [LT,EQ] - ([LT .. LT]) = [LT] - ([GT .. LT]) = [] - ([GT .. EQ]) = [] - ([GT .. GT]) = [GT] - ([LT,EQ .. GT]) = [LT,EQ,GT] - ([GT,EQ .. LT]) = [GT,EQ,LT] - ([GT,EQ .. EQ]) = [GT,EQ] - ([GT,EQ .. GT]) = [GT] - ([GT,EQ .. LT]) = [GT,EQ,LT] - ([LT,EQ .. LT]) = [LT] - ([LT,EQ .. GT]) = [LT,EQ,GT] - take 7 (([LT,LT .. GT])) = [LT,LT,LT,LT,LT,LT,LT] - take 7 (([GT,GT .. LT])) = [] -Testing Enum Bool: - (succ False) = True - (succ (minBound::Bool)) = True - (succ (maxBound::Bool)) = error "Prelude.Enum.Bool.succ: bad argument" - (pred True) = False - (pred (maxBound::Bool)) = False - (pred (minBound::Bool)) = error "Prelude.Enum.Bool.pred: bad argument" - (toEnum 0)::Bool = False - (toEnum 5)::Bool = error "Prelude.Enum.Bool.toEnum: bad argument" - (fromEnum False) = 0 - (fromEnum True) = 1 - ([False ..]) = [False,True] - ([True ..]) = [True] - ([False,True ..]) = [False,True] - ([True,False ..]) = [True,False] - (take 7 ([False,False ..])) = [False,False,False,False,False,False,False] - (take 7 ([True,True ..])) = [True,True,True,True,True,True,True] - ([False .. True]) = [False,True] - ([True .. False]) = [] - take 7 ([False,False .. False]) = [False,False,False,False,False,False,False] - take 7 ([False,False .. True]) = [False,False,False,False,False,False,False] - take 7 ([False,True .. False]) = [False] - take 7 ([False,True .. True]) = [False,True] - take 7 ([True,False .. False]) = [True,False] - take 7 ([True,False .. True]) = [True] - take 7 ([True,True .. False]) = [] - take 7 ([True,True .. True]) = [True,True,True,True,True,True,True] -Testing Enum Rational: - (succ (0::Rational)) = 1 % 1 - (succ ((-1)::Rational)) = 0 % 1 - pred (1::Rational) = 0 % 1 - pred (0::Rational) = (-1) % 1 - (map (toEnum::Int->Rational) [1,minBound,maxBound]) = [1 % 1,(-2147483648) % 1,2147483647 % 1] - (map fromEnum [(1::Rational),42,45]) = [1,42,45] - (take 7 [(1::Rational)..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(-5::Rational)..]) = [(-5) % 1,(-4) % 1,(-3) % 1,(-2) % 1,(-1) % 1,0 % 1,1 % 1] - (take 7 [(1::Rational),2..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(1::Rational),7..]) = [1 % 1,7 % 1,13 % 1,19 % 1,25 % 1,31 % 1,37 % 1] - (take 7 [(1::Rational),1..]) = [1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1] - (take 7 [(1::Rational),0..]) = [1 % 1,0 % 1,(-1) % 1,(-2) % 1,(-3) % 1,(-4) % 1,(-5) % 1] - (take 7 [(5::Rational),2..]) = [5 % 1,2 % 1,(-1) % 1,(-4) % 1,(-7) % 1,(-10) % 1,(-13) % 1] - (take 7 ([(1::Rational) .. 5])) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1] - (take 4 ([(1::Rational) .. 1])) = [1 % 1] - (take 7 ([(1::Rational) .. 0])) = [] - (take 7 ([(5::Rational) .. 0])) = [] - (take 7 [(5::Rational),4..1]) = [5 % 1,4 % 1,3 % 1,2 % 1,1 % 1] - (take 7 [(5::Rational),3..1]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(5::Rational),3..2]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(1::Rational),2..1]) = [1 % 1] - (take 7 [(2::Rational),1..2]) = [2 % 1] - (take 7 [(2::Rational),1..1]) = [2 % 1,1 % 1] - (take 7 [(2::Rational),3..1]) = [] -Testing Enum (Ratio Int): - (succ (0::Ratio Int)) = 1 % 1 - (succ ((-1)::Ratio Int)) = 0 % 1 - pred (1::Ratio Int) = 0 % 1 - pred (0::Ratio Int) = (-1) % 1 - (map (toEnum::Int->Ratio Int) [1,minBound,maxBound]) = [1 % 1,(-2147483648) % 1,2147483647 % 1] - (map fromEnum [(1::Ratio Int),42,45]) = [1,42,45] - (take 7 [(1::Ratio Int)..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(-5::Ratio Int)..]) = [(-5) % 1,(-4) % 1,(-3) % 1,(-2) % 1,(-1) % 1,0 % 1,1 % 1] - (take 7 [((toEnum ((maxBound::Int)-5))::Ratio Int)..]) = [2147483642 % 1,2147483643 % 1,2147483644 % 1,2147483645 % 1,2147483646 % 1,2147483647 % 1,(-2147483648) % 1] - (take 7 [(1::Ratio Int),2..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(1::Ratio Int),7..]) = [1 % 1,7 % 1,13 % 1,19 % 1,25 % 1,31 % 1,37 % 1] - (take 7 [(1::Ratio Int),1..]) = [1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1] - (take 7 [(1::Ratio Int),0..]) = [1 % 1,0 % 1,(-1) % 1,(-2) % 1,(-3) % 1,(-4) % 1,(-5) % 1] - (take 7 [(5::Ratio Int),2..]) = [5 % 1,2 % 1,(-1) % 1,(-4) % 1,(-7) % 1,(-10) % 1,(-13) % 1] - (take 7 [x, x-1 ..]) = [(-2147483647) % 1,(-2147483648) % 1,2147483647 % 1,2147483646 % 1,2147483645 % 1,2147483644 % 1,2147483643 % 1] - (take 7 [x, x-1 ..]) = [(-2147483643) % 1,(-2147483644) % 1,(-2147483645) % 1,(-2147483646) % 1,(-2147483647) % 1,(-2147483648) % 1,2147483647 % 1] - (take 7 [x, (x+1) ..]) = [2147483642 % 1,2147483643 % 1,2147483644 % 1,2147483645 % 1,2147483646 % 1,2147483647 % 1,(-2147483648) % 1] - (take 7 ([(1::Ratio Int) .. 5])) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1] - (take 4 ([(1::Ratio Int) .. 1])) = [1 % 1] - (take 7 ([(1::Ratio Int) .. 0])) = [] - (take 7 ([(5::Ratio Int) .. 0])) = [] - (take 7 ([x..y])) = [2147483642 % 1,2147483643 % 1,2147483644 % 1,2147483645 % 1,2147483646 % 1,2147483647 % 1] - (take 7 ([x..y])) = [] - (take 7 [(5::Ratio Int),4..1]) = [5 % 1,4 % 1,3 % 1,2 % 1,1 % 1] - (take 7 [(5::Ratio Int),3..1]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(5::Ratio Int),3..2]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(1::Ratio Int),2..1]) = [1 % 1] - (take 7 [(2::Ratio Int),1..2]) = [2 % 1] - (take 7 [(2::Ratio Int),1..1]) = [2 % 1,1 % 1] - (take 7 [(2::Ratio Int),3..1]) = [] - (take 7 [x,(x+1)..y]) = [2147483643 % 1,2147483644 % 1,2147483645 % 1,2147483646 % 1,2147483647 % 1] - (take 7 [x,(x-1)..y]) = [(-2147483643) % 1,(-2147483644) % 1,(-2147483645) % 1,(-2147483646) % 1,(-2147483647) % 1,(-2147483648) % 1] diff --git a/testsuite/tests/lib/should_run/enum01.stdout-alpha-dec-osf3 b/testsuite/tests/lib/should_run/enum01.stdout-alpha-dec-osf3 deleted file mode 100644 index 63ba3e2fb3..0000000000 --- a/testsuite/tests/lib/should_run/enum01.stdout-alpha-dec-osf3 +++ /dev/null @@ -1,230 +0,0 @@ -Testing Enum Int: - (succ (0::Int)) = 1 - (succ (minBound::Int)) = -9223372036854775807 - (succ (maxBound::Int)) = error "Prelude.Enum.succ{Int}: tried to take `succ' of maxBound" - pred (1::Int) = 0 - pred (maxBound::Int) = 9223372036854775806 - pred (minBound::Int) = error "Prelude.Enum.pred{Int}: tried to take `pred' of minBound" - (map (toEnum::Int->Int) [1,minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807] - (map fromEnum [(1::Int),minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807] - (take 7 [(1::Int)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [(1::Int),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808] - (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] - (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(1::Int) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int) .. 1])) = [1] - (take 7 ([(1::Int) .. 0])) = [] - (take 7 ([(5::Int) .. 0])) = [] - (take 7 ([(maxBound-(5::Int)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(minBound+(5::Int)) .. minBound])) = [] - (take 7 [(5::Int),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int),3..1]) = [5,3,1] - (take 7 [(5::Int),3..2]) = [5,3] - (take 7 [(1::Int),2..1]) = [1] - (take 7 [(2::Int),1..2]) = [2] - (take 7 [(2::Int),1..1]) = [2,1] - (take 7 [(2::Int),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] -Testing Enum Integer: - (succ (0::Integer)) = 1 - (succ ((-1)::Integer)) = 0 - pred (1::Integer) = 0 - pred (0::Integer) = -1 - (map (toEnum::Int->Integer) [1,minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807] - (map fromEnum [(1::Integer),42,45]) = [1,42,45] - (take 7 [(1::Integer)..]) = [1,2,3,4,5,6,7] - (take 7 [(-5::Integer)..]) = [-5,-4,-3,-2,-1,0,1] - (take 7 [(1::Integer),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Integer),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Integer),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Integer),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Integer),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 ([(1::Integer) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Integer) .. 1])) = [1] - (take 7 ([(1::Integer) .. 0])) = [] - (take 7 ([(5::Integer) .. 0])) = [] - (take 7 [(5::Integer),4..1]) = [5,4,3,2,1] - (take 7 [(5::Integer),3..1]) = [5,3,1] - (take 7 [(5::Integer),3..2]) = [5,3] - (take 7 [(1::Integer),2..1]) = [1] - (take 7 [(2::Integer),1..2]) = [2] - (take 7 [(2::Integer),1..1]) = [2,1] - (take 7 [(2::Integer),3..1]) = [] -Testing Enum Char: - (succ 'a') = 'b' - (succ (minBound::Char)) = '\SOH' - (succ (maxBound::Char)) = error "Prelude.Enum.Char.succ: bad argument" - (pred 'b') = 'a' - pred (maxBound::Char) = '\1114110' - pred (minBound::Char) = error "Prelude.Enum.Char.pred: bad argument" - (map (toEnum::Int->Char) [123,ord (minBound::Char), ord(maxBound::Char)]) = "{\NUL\1114111" - (toEnum::Int->Char) (minBound::Int) = error "Prelude.chr: bad argument" - (map fromEnum ['X',minBound,maxBound]) = [88,0,1114111] - (take 7 ['\NUL' .. ]) = "\NUL\SOH\STX\ETX\EOT\ENQ\ACK" - (take 7 ['\250' .. ]) = "\250\251\252\253\254\255\256" - (take 7 ['a','b'..]) = "abcdefg" - (take 7 ['a','e'..]) = "aeimquy" - (take 7 ['a','a'..]) = "aaaaaaa" - (take 7 ['z','y'..]) = "zyxwvut" - (take 7 ['z','v'..]) = "zvrnjfb" - (take 7 ['\1', '\0' ..]) = "\SOH\NUL" - (take 7 ['\5', '\4' ..]) = "\ENQ\EOT\ETX\STX\SOH\NUL" - (take 7 ['\250', '\251' ..]) = "\250\251\252\253\254\255\256" - (take 7 (['a' .. 'e'])) = "abcde" - (take 4 (['a' .. 'a'])) = "a" - (take 7 (['b' .. 'a'])) = "" - (take 7 (['e' .. 'a'])) = "" - (take 7 (['\250' .. '\255'])) = "\250\251\252\253\254\255" - (take 7 (['\5' .. '\0'])) = "" - (take 7 ['f','e' .. 'b']) = "fedcb" - (take 7 ['g','e' .. 'b']) = "gec" - (take 7 ['g','d' .. 'c']) = "gd" - (take 7 ['b','c' .. 'b']) = "b" - (take 7 ['c','b' .. 'c']) = "c" - (take 7 ['c','b' .. 'b']) = "cb" - (take 7 ['c','d' .. 'b']) = "" - (take 7 ['\251', '\252' .. maxBound]) = "\251\252\253\254\255\256\257" - (take 7 ['\5', '\4' .. minBound]) = "\ENQ\EOT\ETX\STX\SOH\NUL" -Testing Enum (): - (succ ()) = error "Prelude.Enum.().succ: bad argument" - (succ (minBound::())) = error "Prelude.Enum.().succ: bad argument" - (succ (maxBound::())) = error "Prelude.Enum.().succ: bad argument" - (pred ()) = error "Prelude.Enum.().pred: bad argument" - (pred (minBound::())) = error "Prelude.Enum.().pred: bad argument" - (pred (maxBound::())) = error "Prelude.Enum.().pred: bad argument" - (toEnum 0)::() = () - (toEnum 1)::() = error "Prelude.Enum.().toEnum: bad argument" - (fromEnum ()) = 0 - (take 7 [()..]) = [()] - (take 7 [(),()..]) = [(),(),(),(),(),(),()] - (take 7 [()..()]) = [()] - (take 7 [(),()..()]) = [(),(),(),(),(),(),()] -Testing Enum Ordering (derived): - (succ LT) = EQ - (succ (minBound::Ordering)) = EQ - (succ (maxBound::Ordering)) = error "Prelude.Enum.Ordering.succ: bad argument" - (pred GT) = EQ - (pred (maxBound::Ordering)) = EQ - (pred (minBound::Ordering)) = error "Prelude.Enum.Ordering.pred: bad argument" - (toEnum 0)::Ordering = LT - (toEnum 5)::Ordering = error "Prelude.Enum.Ordering.toEnum: bad argument" - (fromEnum LT) = 0 - (fromEnum EQ) = 1 - (fromEnum GT) = 2 - ([LT ..]) = [LT,EQ,GT] - ([EQ ..]) = [EQ,GT] - ([GT ..]) = [GT] - ([LT,EQ ..]) = [LT,EQ,GT] - ([EQ,GT ..]) = [EQ,GT] - ([EQ,LT ..]) = [EQ,LT] - ([LT,GT ..]) = [LT,GT] - ([GT,LT ..]) = [GT,LT] - take 7 (([GT,GT ..])) = [GT,GT,GT,GT,GT,GT,GT] - take 7 (([LT,LT ..])) = [LT,LT,LT,LT,LT,LT,LT] - ([LT .. GT]) = [LT,EQ,GT] - ([LT .. EQ]) = [LT,EQ] - ([LT .. LT]) = [LT] - ([GT .. LT]) = [] - ([GT .. EQ]) = [] - ([GT .. GT]) = [GT] - ([LT,EQ .. GT]) = [LT,EQ,GT] - ([GT,EQ .. LT]) = [GT,EQ,LT] - ([GT,EQ .. EQ]) = [GT,EQ] - ([GT,EQ .. GT]) = [GT] - ([GT,EQ .. LT]) = [GT,EQ,LT] - ([LT,EQ .. LT]) = [LT] - ([LT,EQ .. GT]) = [LT,EQ,GT] - take 7 (([LT,LT .. GT])) = [LT,LT,LT,LT,LT,LT,LT] - take 7 (([GT,GT .. LT])) = [] -Testing Enum Bool: - (succ False) = True - (succ (minBound::Bool)) = True - (succ (maxBound::Bool)) = error "Prelude.Enum.Bool.succ: bad argument" - (pred True) = False - (pred (maxBound::Bool)) = False - (pred (minBound::Bool)) = error "Prelude.Enum.Bool.pred: bad argument" - (toEnum 0)::Bool = False - (toEnum 5)::Bool = error "Prelude.Enum.Bool.toEnum: bad argument" - (fromEnum False) = 0 - (fromEnum True) = 1 - ([False ..]) = [False,True] - ([True ..]) = [True] - ([False,True ..]) = [False,True] - ([True,False ..]) = [True,False] - (take 7 ([False,False ..])) = [False,False,False,False,False,False,False] - (take 7 ([True,True ..])) = [True,True,True,True,True,True,True] - ([False .. True]) = [False,True] - ([True .. False]) = [] - take 7 ([False,False .. False]) = [False,False,False,False,False,False,False] - take 7 ([False,False .. True]) = [False,False,False,False,False,False,False] - take 7 ([False,True .. False]) = [False] - take 7 ([False,True .. True]) = [False,True] - take 7 ([True,False .. False]) = [True,False] - take 7 ([True,False .. True]) = [True] - take 7 ([True,True .. False]) = [] - take 7 ([True,True .. True]) = [True,True,True,True,True,True,True] -Testing Enum Rational: - (succ (0::Rational)) = 1%1 - (succ ((-1)::Rational)) = 0%1 - pred (1::Rational) = 0%1 - pred (0::Rational) = (-1)%1 - (map (toEnum::Int->Rational) [1,minBound,maxBound]) = [1%1,(-9223372036854775808)%1,9223372036854775807%1] - (map fromEnum [(1::Rational),42,45]) = [1,42,45] - (take 7 [(1::Rational)..]) = [1%1,2%1,3%1,4%1,5%1,6%1,7%1] - (take 7 [(-5::Rational)..]) = [(-5)%1,(-4)%1,(-3)%1,(-2)%1,(-1)%1,0%1,1%1] - (take 7 [(1::Rational),2..]) = [1%1,2%1,3%1,4%1,5%1,6%1,7%1] - (take 7 [(1::Rational),7..]) = [1%1,7%1,13%1,19%1,25%1,31%1,37%1] - (take 7 [(1::Rational),1..]) = [1%1,1%1,1%1,1%1,1%1,1%1,1%1] - (take 7 [(1::Rational),0..]) = [1%1,0%1,(-1)%1,(-2)%1,(-3)%1,(-4)%1,(-5)%1] - (take 7 [(5::Rational),2..]) = [5%1,2%1,(-1)%1,(-4)%1,(-7)%1,(-10)%1,(-13)%1] - (take 7 ([(1::Rational) .. 5])) = [1%1,2%1,3%1,4%1,5%1] - (take 4 ([(1::Rational) .. 1])) = [1%1] - (take 7 ([(1::Rational) .. 0])) = [] - (take 7 ([(5::Rational) .. 0])) = [] - (take 7 [(5::Rational),4..1]) = [5%1,4%1,3%1,2%1,1%1] - (take 7 [(5::Rational),3..1]) = [5%1,3%1,1%1] - (take 7 [(5::Rational),3..2]) = [5%1,3%1,1%1] - (take 7 [(1::Rational),2..1]) = [1%1] - (take 7 [(2::Rational),1..2]) = [2%1] - (take 7 [(2::Rational),1..1]) = [2%1,1%1] - (take 7 [(2::Rational),3..1]) = [] -Testing Enum (Ratio Int): - (succ (0::Ratio Int)) = 1%1 - (succ ((-1)::Ratio Int)) = 0%1 - pred (1::Ratio Int) = 0%1 - pred (0::Ratio Int) = (-1)%1 - (map (toEnum::Int->Ratio Int) [1,minBound,maxBound]) = [1%1,(-9223372036854775808)%1,9223372036854775807%1] - (map fromEnum [(1::Ratio Int),42,45]) = [1,42,45] - (take 7 [(1::Ratio Int)..]) = [1%1,2%1,3%1,4%1,5%1,6%1,7%1] - (take 7 [(-5::Ratio Int)..]) = [(-5)%1,(-4)%1,(-3)%1,(-2)%1,(-1)%1,0%1,1%1] - (take 7 [((toEnum ((maxBound::Int)-5))::Ratio Int)..]) = [9223372036854775802%1,9223372036854775803%1,9223372036854775804%1,9223372036854775805%1,9223372036854775806%1,9223372036854775807%1,(-9223372036854775808)%1] - (take 7 [(1::Ratio Int),2..]) = [1%1,2%1,3%1,4%1,5%1,6%1,7%1] - (take 7 [(1::Ratio Int),7..]) = [1%1,7%1,13%1,19%1,25%1,31%1,37%1] - (take 7 [(1::Ratio Int),1..]) = [1%1,1%1,1%1,1%1,1%1,1%1,1%1] - (take 7 [(1::Ratio Int),0..]) = [1%1,0%1,(-1)%1,(-2)%1,(-3)%1,(-4)%1,(-5)%1] - (take 7 [(5::Ratio Int),2..]) = [5%1,2%1,(-1)%1,(-4)%1,(-7)%1,(-10)%1,(-13)%1] - (take 7 [x, x-1 ..]) = [(-9223372036854775807)%1,(-9223372036854775808)%1,9223372036854775807%1,9223372036854775806%1,9223372036854775805%1,9223372036854775804%1,9223372036854775803%1] - (take 7 [x, x-1 ..]) = [(-9223372036854775803)%1,(-9223372036854775804)%1,(-9223372036854775805)%1,(-9223372036854775806)%1,(-9223372036854775807)%1,(-9223372036854775808)%1,9223372036854775807%1] - (take 7 [x, (x+1) ..]) = [9223372036854775802%1,9223372036854775803%1,9223372036854775804%1,9223372036854775805%1,9223372036854775806%1,9223372036854775807%1,(-9223372036854775808)%1] - (take 7 ([(1::Ratio Int) .. 5])) = [1%1,2%1,3%1,4%1,5%1] - (take 4 ([(1::Ratio Int) .. 1])) = [1%1] - (take 7 ([(1::Ratio Int) .. 0])) = [] - (take 7 ([(5::Ratio Int) .. 0])) = [] - (take 7 ([x..y])) = [9223372036854775802%1,9223372036854775803%1,9223372036854775804%1,9223372036854775805%1,9223372036854775806%1,9223372036854775807%1] - (take 7 ([x..y])) = [] - (take 7 [(5::Ratio Int),4..1]) = [5%1,4%1,3%1,2%1,1%1] - (take 7 [(5::Ratio Int),3..1]) = [5%1,3%1,1%1] - (take 7 [(5::Ratio Int),3..2]) = [5%1,3%1,1%1] - (take 7 [(1::Ratio Int),2..1]) = [1%1] - (take 7 [(2::Ratio Int),1..2]) = [2%1] - (take 7 [(2::Ratio Int),1..1]) = [2%1,1%1] - (take 7 [(2::Ratio Int),3..1]) = [] - (take 7 [x,(x+1)..y]) = [9223372036854775803%1,9223372036854775804%1,9223372036854775805%1,9223372036854775806%1,9223372036854775807%1] - (take 7 [x,(x-1)..y]) = [(-9223372036854775803)%1,(-9223372036854775804)%1,(-9223372036854775805)%1,(-9223372036854775806)%1,(-9223372036854775807)%1,(-9223372036854775808)%1] diff --git a/testsuite/tests/lib/should_run/enum01.stdout-hugs b/testsuite/tests/lib/should_run/enum01.stdout-hugs deleted file mode 100644 index 41bb64d598..0000000000 --- a/testsuite/tests/lib/should_run/enum01.stdout-hugs +++ /dev/null @@ -1,246 +0,0 @@ -Testing Enum Int: - (succ (0::Int)) = 1 - (succ (minBound::Int)) = -2147483647 - (succ (maxBound::Int)) = error "succ: applied to maxBound" - pred (1::Int) = 0 - pred (maxBound::Int) = 2147483646 - pred (minBound::Int) = error "pred: applied to minBound" - (map (toEnum::Int->Int) [1,minBound,maxBound]) = [1,-2147483648,2147483647] - (map fromEnum [(1::Int),minBound,maxBound]) = [1,-2147483648,2147483647] - (take 7 [(1::Int)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int)-5)..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [(1::Int),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-2147483647,-2147483648] - (take 7 [x, x-1 ..]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] - (take 7 [x, (x+1) ..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - ([minBound::Int,1..]) = [-2147483648,1] - ([minBound::Int,0..]) = [-2147483648,0] - ([minBound::Int,-1..]) = [-2147483648,-1,2147483646] - ([maxBound::Int,1..]) = [2147483647,1,-2147483645] - ([maxBound::Int,0..]) = [2147483647,0,-2147483647] - ([maxBound::Int,-1..]) = [2147483647,-1] - (take 7 ([(1::Int) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int) .. 1])) = [1] - (take 7 ([(1::Int) .. 0])) = [] - (take 7 ([(5::Int) .. 0])) = [] - (take 7 ([(maxBound-(5::Int)) .. maxBound])) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(minBound+(5::Int)) .. minBound])) = [] - (take 7 [(5::Int),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int),3..1]) = [5,3,1] - (take 7 [(5::Int),3..2]) = [5,3] - (take 7 [(1::Int),2..1]) = [1] - (take 7 [(2::Int),1..2]) = [2] - (take 7 [(2::Int),1..1]) = [2,1] - (take 7 [(2::Int),3..1]) = [] - ([minBound, 1..maxBound::Int]) = [-2147483648,1] - ([minBound, 0..maxBound::Int]) = [-2147483648,0] - ([minBound,-1..maxBound::Int]) = [-2147483648,-1,2147483646] - ([minBound,-1..maxBound-1::Int]) = [-2147483648,-1,2147483646] - ([minBound,-1..maxBound-2::Int]) = [-2147483648,-1] - ([maxBound, 1..minBound::Int]) = [2147483647,1,-2147483645] - ([maxBound, 0..minBound::Int]) = [2147483647,0,-2147483647] - ([maxBound, 0..minBound+1::Int]) = [2147483647,0,-2147483647] - ([maxBound, 0..minBound+2::Int]) = [2147483647,0] - ([maxBound,-1..minBound::Int]) = [2147483647,-1] - (take 7 [x,(x+1)..maxBound]) = [2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [x,(x-1)..minBound]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] -Testing Enum Integer: - (succ (0::Integer)) = 1 - (succ ((-1)::Integer)) = 0 - pred (1::Integer) = 0 - pred (0::Integer) = -1 - (map (toEnum::Int->Integer) [1,minBound,maxBound]) = [1,-2147483648,2147483647] - (map fromEnum [(1::Integer),42,45]) = [1,42,45] - (take 7 [(1::Integer)..]) = [1,2,3,4,5,6,7] - (take 7 [(-5::Integer)..]) = [-5,-4,-3,-2,-1,0,1] - (take 7 [(1::Integer),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Integer),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Integer),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Integer),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Integer),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 ([(1::Integer) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Integer) .. 1])) = [1] - (take 7 ([(1::Integer) .. 0])) = [] - (take 7 ([(5::Integer) .. 0])) = [] - (take 7 [(5::Integer),4..1]) = [5,4,3,2,1] - (take 7 [(5::Integer),3..1]) = [5,3,1] - (take 7 [(5::Integer),3..2]) = [5,3] - (take 7 [(1::Integer),2..1]) = [1] - (take 7 [(2::Integer),1..2]) = [2] - (take 7 [(2::Integer),1..1]) = [2,1] - (take 7 [(2::Integer),3..1]) = [] -Testing Enum Char: - (succ 'a') = 'b' - (succ (minBound::Char)) = '\SOH' - (succ (maxBound::Char)) = error "chr: out of range" - (pred 'b') = 'a' - pred (maxBound::Char) = '\1114110' - pred (minBound::Char) = error "chr: out of range" - (map (toEnum::Int->Char) [123,ord (minBound::Char), ord(maxBound::Char)]) = "{\NUL\1114111" - (toEnum::Int->Char) (minBound::Int) = error "chr: out of range" - (map fromEnum ['X',minBound,maxBound]) = [88,0,1114111] - (take 7 ['\NUL' .. ]) = "\NUL\SOH\STX\ETX\EOT\ENQ\ACK" - (take 7 ['\250' .. ]) = "\250\251\252\253\254\255\256" - (take 7 ['a','b'..]) = "abcdefg" - (take 7 ['a','e'..]) = "aeimquy" - (take 7 ['a','a'..]) = "aaaaaaa" - (take 7 ['z','y'..]) = "zyxwvut" - (take 7 ['z','v'..]) = "zvrnjfb" - (take 7 ['\1', '\0' ..]) = "\SOH\NUL" - (take 7 ['\5', '\4' ..]) = "\ENQ\EOT\ETX\STX\SOH\NUL" - (take 7 ['\250', '\251' ..]) = "\250\251\252\253\254\255\256" - (take 7 (['a' .. 'e'])) = "abcde" - (take 4 (['a' .. 'a'])) = "a" - (take 7 (['b' .. 'a'])) = "" - (take 7 (['e' .. 'a'])) = "" - (take 7 (['\250' .. '\255'])) = "\250\251\252\253\254\255" - (take 7 (['\5' .. '\0'])) = "" - (take 7 ['f','e' .. 'b']) = "fedcb" - (take 7 ['g','e' .. 'b']) = "gec" - (take 7 ['g','d' .. 'c']) = "gd" - (take 7 ['b','c' .. 'b']) = "b" - (take 7 ['c','b' .. 'c']) = "c" - (take 7 ['c','b' .. 'b']) = "cb" - (take 7 ['c','d' .. 'b']) = "" - (take 7 ['\251', '\252' .. maxBound]) = "\251\252\253\254\255\256\257" - (take 7 ['\5', '\4' .. minBound]) = "\ENQ\EOT\ETX\STX\SOH\NUL" -Testing Enum (): - (succ ()) = Fail: pattern match failure - (succ (minBound::())) = Fail: pattern match failure - (succ (maxBound::())) = Fail: pattern match failure - (pred ()) = Fail: pattern match failure - (pred (minBound::())) = Fail: pattern match failure - (pred (maxBound::())) = Fail: pattern match failure - (toEnum 0)::() = () - (toEnum 1)::() = Fail: pattern match failure - (fromEnum ()) = 0 - (take 7 [()..]) = [()] - (take 7 [(),()..]) = [(),(),(),(),(),(),()] - (take 7 [()..()]) = [()] - (take 7 [(),()..()]) = [(),(),(),(),(),(),()] -Testing Enum Ordering (derived): - (succ LT) = EQ - (succ (minBound::Ordering)) = EQ - (succ (maxBound::Ordering)) = error "toEnum: out of range" - (pred GT) = EQ - (pred (maxBound::Ordering)) = EQ - (pred (minBound::Ordering)) = error "toEnum: out of range" - (toEnum 0)::Ordering = LT - (toEnum 5)::Ordering = error "toEnum: out of range" - (fromEnum LT) = 0 - (fromEnum EQ) = 1 - (fromEnum GT) = 2 - ([LT ..]) = [LT,EQ,GT] - ([EQ ..]) = [EQ,GT] - ([GT ..]) = [GT] - ([LT,EQ ..]) = [LT,EQ,GT] - ([EQ,GT ..]) = [EQ,GT] - ([EQ,LT ..]) = [EQ,LT] - ([LT,GT ..]) = [LT,GT] - ([GT,LT ..]) = [GT,LT] - take 7 (([GT,GT ..])) = [GT,GT,GT,GT,GT,GT,GT] - take 7 (([LT,LT ..])) = [LT,LT,LT,LT,LT,LT,LT] - ([LT .. GT]) = [LT,EQ,GT] - ([LT .. EQ]) = [LT,EQ] - ([LT .. LT]) = [LT] - ([GT .. LT]) = [] - ([GT .. EQ]) = [] - ([GT .. GT]) = [GT] - ([LT,EQ .. GT]) = [LT,EQ,GT] - ([GT,EQ .. LT]) = [GT,EQ,LT] - ([GT,EQ .. EQ]) = [GT,EQ] - ([GT,EQ .. GT]) = [GT] - ([GT,EQ .. LT]) = [GT,EQ,LT] - ([LT,EQ .. LT]) = [LT] - ([LT,EQ .. GT]) = [LT,EQ,GT] - take 7 (([LT,LT .. GT])) = [LT,LT,LT,LT,LT,LT,LT] - take 7 (([GT,GT .. LT])) = [] -Testing Enum Bool: - (succ False) = True - (succ (minBound::Bool)) = True - (succ (maxBound::Bool)) = error "toEnum: out of range" - (pred True) = False - (pred (maxBound::Bool)) = False - (pred (minBound::Bool)) = error "toEnum: out of range" - (toEnum 0)::Bool = False - (toEnum 5)::Bool = error "toEnum: out of range" - (fromEnum False) = 0 - (fromEnum True) = 1 - ([False ..]) = [False,True] - ([True ..]) = [True] - ([False,True ..]) = [False,True] - ([True,False ..]) = [True,False] - (take 7 ([False,False ..])) = [False,False,False,False,False,False,False] - (take 7 ([True,True ..])) = [True,True,True,True,True,True,True] - ([False .. True]) = [False,True] - ([True .. False]) = [] - take 7 ([False,False .. False]) = [False,False,False,False,False,False,False] - take 7 ([False,False .. True]) = [False,False,False,False,False,False,False] - take 7 ([False,True .. False]) = [False] - take 7 ([False,True .. True]) = [False,True] - take 7 ([True,False .. False]) = [True,False] - take 7 ([True,False .. True]) = [True] - take 7 ([True,True .. False]) = [] - take 7 ([True,True .. True]) = [True,True,True,True,True,True,True] -Testing Enum Rational: - (succ (0::Rational)) = 1 % 1 - (succ ((-1)::Rational)) = 0 % 1 - pred (1::Rational) = 0 % 1 - pred (0::Rational) = (-1) % 1 - (map (toEnum::Int->Rational) [1,minBound,maxBound]) = [1 % 1,(-2147483648) % 1,2147483647 % 1] - (map fromEnum [(1::Rational),42,45]) = [1,42,45] - (take 7 [(1::Rational)..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(-5::Rational)..]) = [(-5) % 1,(-4) % 1,(-3) % 1,(-2) % 1,(-1) % 1,0 % 1,1 % 1] - (take 7 [(1::Rational),2..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(1::Rational),7..]) = [1 % 1,7 % 1,13 % 1,19 % 1,25 % 1,31 % 1,37 % 1] - (take 7 [(1::Rational),1..]) = [1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1] - (take 7 [(1::Rational),0..]) = [1 % 1,0 % 1,(-1) % 1,(-2) % 1,(-3) % 1,(-4) % 1,(-5) % 1] - (take 7 [(5::Rational),2..]) = [5 % 1,2 % 1,(-1) % 1,(-4) % 1,(-7) % 1,(-10) % 1,(-13) % 1] - (take 7 ([(1::Rational) .. 5])) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1] - (take 4 ([(1::Rational) .. 1])) = [1 % 1] - (take 7 ([(1::Rational) .. 0])) = [] - (take 7 ([(5::Rational) .. 0])) = [] - (take 7 [(5::Rational),4..1]) = [5 % 1,4 % 1,3 % 1,2 % 1,1 % 1] - (take 7 [(5::Rational),3..1]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(5::Rational),3..2]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(1::Rational),2..1]) = [1 % 1] - (take 7 [(2::Rational),1..2]) = [2 % 1] - (take 7 [(2::Rational),1..1]) = [2 % 1,1 % 1] - (take 7 [(2::Rational),3..1]) = [] -Testing Enum (Ratio Int): - (succ (0::Ratio Int)) = 1 % 1 - (succ ((-1)::Ratio Int)) = 0 % 1 - pred (1::Ratio Int) = 0 % 1 - pred (0::Ratio Int) = (-1) % 1 - (map (toEnum::Int->Ratio Int) [1,minBound,maxBound]) = [1 % 1,(-2147483648) % 1,2147483647 % 1] - (map fromEnum [(1::Ratio Int),42,45]) = [1,42,45] - (take 7 [(1::Ratio Int)..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(-5::Ratio Int)..]) = [(-5) % 1,(-4) % 1,(-3) % 1,(-2) % 1,(-1) % 1,0 % 1,1 % 1] - (take 7 [((toEnum ((maxBound::Int)-5))::Ratio Int)..]) = [2147483642 % 1,2147483643 % 1,2147483644 % 1,2147483645 % 1,2147483646 % 1,2147483647 % 1,(-2147483648) % 1] - (take 7 [(1::Ratio Int),2..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(1::Ratio Int),7..]) = [1 % 1,7 % 1,13 % 1,19 % 1,25 % 1,31 % 1,37 % 1] - (take 7 [(1::Ratio Int),1..]) = [1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1] - (take 7 [(1::Ratio Int),0..]) = [1 % 1,0 % 1,(-1) % 1,(-2) % 1,(-3) % 1,(-4) % 1,(-5) % 1] - (take 7 [(5::Ratio Int),2..]) = [5 % 1,2 % 1,(-1) % 1,(-4) % 1,(-7) % 1,(-10) % 1,(-13) % 1] - (take 7 [x, x-1 ..]) = [(-2147483647) % 1,(-2147483648) % 1,2147483647 % 1,2147483646 % 1,2147483645 % 1,2147483644 % 1,2147483643 % 1] - (take 7 [x, x-1 ..]) = [(-2147483643) % 1,(-2147483644) % 1,(-2147483645) % 1,(-2147483646) % 1,(-2147483647) % 1,(-2147483648) % 1,2147483647 % 1] - (take 7 [x, (x+1) ..]) = [2147483642 % 1,2147483643 % 1,2147483644 % 1,2147483645 % 1,2147483646 % 1,2147483647 % 1,(-2147483648) % 1] - (take 7 ([(1::Ratio Int) .. 5])) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1] - (take 4 ([(1::Ratio Int) .. 1])) = [1 % 1] - (take 7 ([(1::Ratio Int) .. 0])) = [] - (take 7 ([(5::Ratio Int) .. 0])) = [] - (take 7 ([x..y])) = [2147483642 % 1,2147483643 % 1,2147483644 % 1,2147483645 % 1,2147483646 % 1,2147483647 % 1] - (take 7 ([x..y])) = [] - (take 7 [(5::Ratio Int),4..1]) = [5 % 1,4 % 1,3 % 1,2 % 1,1 % 1] - (take 7 [(5::Ratio Int),3..1]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(5::Ratio Int),3..2]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(1::Ratio Int),2..1]) = [1 % 1] - (take 7 [(2::Ratio Int),1..2]) = [2 % 1] - (take 7 [(2::Ratio Int),1..1]) = [2 % 1,1 % 1] - (take 7 [(2::Ratio Int),3..1]) = [] - (take 7 [x,(x+1)..y]) = [2147483643 % 1,2147483644 % 1,2147483645 % 1,2147483646 % 1,2147483647 % 1] - (take 7 [x,(x-1)..y]) = [(-2147483643) % 1,(-2147483644) % 1,(-2147483645) % 1,(-2147483646) % 1,(-2147483647) % 1,(-2147483648) % 1] diff --git a/testsuite/tests/lib/should_run/enum01.stdout-ws-64 b/testsuite/tests/lib/should_run/enum01.stdout-ws-64 deleted file mode 100644 index 3804dd2470..0000000000 --- a/testsuite/tests/lib/should_run/enum01.stdout-ws-64 +++ /dev/null @@ -1,246 +0,0 @@ -Testing Enum Int: - (succ (0::Int)) = 1 - (succ (minBound::Int)) = -9223372036854775807 - (succ (maxBound::Int)) = error "Prelude.Enum.succ{Int}: tried to take `succ' of maxBound" - pred (1::Int) = 0 - pred (maxBound::Int) = 9223372036854775806 - pred (minBound::Int) = error "Prelude.Enum.pred{Int}: tried to take `pred' of minBound" - (map (toEnum::Int->Int) [1,minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807] - (map fromEnum [(1::Int),minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807] - (take 7 [(1::Int)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [(1::Int),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808] - (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] - (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - ([minBound::Int,1..]) = [-9223372036854775808,1] - ([minBound::Int,0..]) = [-9223372036854775808,0] - ([minBound::Int,-1..]) = [-9223372036854775808,-1,9223372036854775806] - ([maxBound::Int,1..]) = [9223372036854775807,1,-9223372036854775805] - ([maxBound::Int,0..]) = [9223372036854775807,0,-9223372036854775807] - ([maxBound::Int,-1..]) = [9223372036854775807,-1] - (take 7 ([(1::Int) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int) .. 1])) = [1] - (take 7 ([(1::Int) .. 0])) = [] - (take 7 ([(5::Int) .. 0])) = [] - (take 7 ([(maxBound-(5::Int)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(minBound+(5::Int)) .. minBound])) = [] - (take 7 [(5::Int),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int),3..1]) = [5,3,1] - (take 7 [(5::Int),3..2]) = [5,3] - (take 7 [(1::Int),2..1]) = [1] - (take 7 [(2::Int),1..2]) = [2] - (take 7 [(2::Int),1..1]) = [2,1] - (take 7 [(2::Int),3..1]) = [] - ([minBound, 1..maxBound::Int]) = [-9223372036854775808,1] - ([minBound, 0..maxBound::Int]) = [-9223372036854775808,0] - ([minBound,-1..maxBound::Int]) = [-9223372036854775808,-1,9223372036854775806] - ([minBound,-1..maxBound-1::Int]) = [-9223372036854775808,-1,9223372036854775806] - ([minBound,-1..maxBound-2::Int]) = [-9223372036854775808,-1] - ([maxBound, 1..minBound::Int]) = [9223372036854775807,1,-9223372036854775805] - ([maxBound, 0..minBound::Int]) = [9223372036854775807,0,-9223372036854775807] - ([maxBound, 0..minBound+1::Int]) = [9223372036854775807,0,-9223372036854775807] - ([maxBound, 0..minBound+2::Int]) = [9223372036854775807,0] - ([maxBound,-1..minBound::Int]) = [9223372036854775807,-1] - (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] -Testing Enum Integer: - (succ (0::Integer)) = 1 - (succ ((-1)::Integer)) = 0 - pred (1::Integer) = 0 - pred (0::Integer) = -1 - (map (toEnum::Int->Integer) [1,minBound,maxBound]) = [1,-9223372036854775808,9223372036854775807] - (map fromEnum [(1::Integer),42,45]) = [1,42,45] - (take 7 [(1::Integer)..]) = [1,2,3,4,5,6,7] - (take 7 [(-5::Integer)..]) = [-5,-4,-3,-2,-1,0,1] - (take 7 [(1::Integer),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Integer),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Integer),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Integer),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Integer),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 ([(1::Integer) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Integer) .. 1])) = [1] - (take 7 ([(1::Integer) .. 0])) = [] - (take 7 ([(5::Integer) .. 0])) = [] - (take 7 [(5::Integer),4..1]) = [5,4,3,2,1] - (take 7 [(5::Integer),3..1]) = [5,3,1] - (take 7 [(5::Integer),3..2]) = [5,3] - (take 7 [(1::Integer),2..1]) = [1] - (take 7 [(2::Integer),1..2]) = [2] - (take 7 [(2::Integer),1..1]) = [2,1] - (take 7 [(2::Integer),3..1]) = [] -Testing Enum Char: - (succ 'a') = 'b' - (succ (minBound::Char)) = '\SOH' - (succ (maxBound::Char)) = error "Prelude.Enum.Char.succ: bad argument" - (pred 'b') = 'a' - pred (maxBound::Char) = '\1114110' - pred (minBound::Char) = error "Prelude.Enum.Char.pred: bad argument" - (map (toEnum::Int->Char) [123,ord (minBound::Char), ord(maxBound::Char)]) = "{\NUL\1114111" - (toEnum::Int->Char) (minBound::Int) = error "Prelude.chr: bad argument: (-9223372036854775808)" - (map fromEnum ['X',minBound,maxBound]) = [88,0,1114111] - (take 7 ['\NUL' .. ]) = "\NUL\SOH\STX\ETX\EOT\ENQ\ACK" - (take 7 ['\250' .. ]) = "\250\251\252\253\254\255\256" - (take 7 ['a','b'..]) = "abcdefg" - (take 7 ['a','e'..]) = "aeimquy" - (take 7 ['a','a'..]) = "aaaaaaa" - (take 7 ['z','y'..]) = "zyxwvut" - (take 7 ['z','v'..]) = "zvrnjfb" - (take 7 ['\1', '\0' ..]) = "\SOH\NUL" - (take 7 ['\5', '\4' ..]) = "\ENQ\EOT\ETX\STX\SOH\NUL" - (take 7 ['\250', '\251' ..]) = "\250\251\252\253\254\255\256" - (take 7 (['a' .. 'e'])) = "abcde" - (take 4 (['a' .. 'a'])) = "a" - (take 7 (['b' .. 'a'])) = "" - (take 7 (['e' .. 'a'])) = "" - (take 7 (['\250' .. '\255'])) = "\250\251\252\253\254\255" - (take 7 (['\5' .. '\0'])) = "" - (take 7 ['f','e' .. 'b']) = "fedcb" - (take 7 ['g','e' .. 'b']) = "gec" - (take 7 ['g','d' .. 'c']) = "gd" - (take 7 ['b','c' .. 'b']) = "b" - (take 7 ['c','b' .. 'c']) = "c" - (take 7 ['c','b' .. 'b']) = "cb" - (take 7 ['c','d' .. 'b']) = "" - (take 7 ['\251', '\252' .. maxBound]) = "\251\252\253\254\255\256\257" - (take 7 ['\5', '\4' .. minBound]) = "\ENQ\EOT\ETX\STX\SOH\NUL" -Testing Enum (): - (succ ()) = error "Prelude.Enum.().succ: bad argument" - (succ (minBound::())) = error "Prelude.Enum.().succ: bad argument" - (succ (maxBound::())) = error "Prelude.Enum.().succ: bad argument" - (pred ()) = error "Prelude.Enum.().pred: bad argument" - (pred (minBound::())) = error "Prelude.Enum.().pred: bad argument" - (pred (maxBound::())) = error "Prelude.Enum.().pred: bad argument" - (toEnum 0)::() = () - (toEnum 1)::() = error "Prelude.Enum.().toEnum: bad argument" - (fromEnum ()) = 0 - (take 7 [()..]) = [()] - (take 7 [(),()..]) = [(),(),(),(),(),(),()] - (take 7 [()..()]) = [()] - (take 7 [(),()..()]) = [(),(),(),(),(),(),()] -Testing Enum Ordering (derived): - (succ LT) = EQ - (succ (minBound::Ordering)) = EQ - (succ (maxBound::Ordering)) = error "Prelude.Enum.Ordering.succ: bad argument" - (pred GT) = EQ - (pred (maxBound::Ordering)) = EQ - (pred (minBound::Ordering)) = error "Prelude.Enum.Ordering.pred: bad argument" - (toEnum 0)::Ordering = LT - (toEnum 5)::Ordering = error "Prelude.Enum.Ordering.toEnum: bad argument" - (fromEnum LT) = 0 - (fromEnum EQ) = 1 - (fromEnum GT) = 2 - ([LT ..]) = [LT,EQ,GT] - ([EQ ..]) = [EQ,GT] - ([GT ..]) = [GT] - ([LT,EQ ..]) = [LT,EQ,GT] - ([EQ,GT ..]) = [EQ,GT] - ([EQ,LT ..]) = [EQ,LT] - ([LT,GT ..]) = [LT,GT] - ([GT,LT ..]) = [GT,LT] - take 7 (([GT,GT ..])) = [GT,GT,GT,GT,GT,GT,GT] - take 7 (([LT,LT ..])) = [LT,LT,LT,LT,LT,LT,LT] - ([LT .. GT]) = [LT,EQ,GT] - ([LT .. EQ]) = [LT,EQ] - ([LT .. LT]) = [LT] - ([GT .. LT]) = [] - ([GT .. EQ]) = [] - ([GT .. GT]) = [GT] - ([LT,EQ .. GT]) = [LT,EQ,GT] - ([GT,EQ .. LT]) = [GT,EQ,LT] - ([GT,EQ .. EQ]) = [GT,EQ] - ([GT,EQ .. GT]) = [GT] - ([GT,EQ .. LT]) = [GT,EQ,LT] - ([LT,EQ .. LT]) = [LT] - ([LT,EQ .. GT]) = [LT,EQ,GT] - take 7 (([LT,LT .. GT])) = [LT,LT,LT,LT,LT,LT,LT] - take 7 (([GT,GT .. LT])) = [] -Testing Enum Bool: - (succ False) = True - (succ (minBound::Bool)) = True - (succ (maxBound::Bool)) = error "Prelude.Enum.Bool.succ: bad argument" - (pred True) = False - (pred (maxBound::Bool)) = False - (pred (minBound::Bool)) = error "Prelude.Enum.Bool.pred: bad argument" - (toEnum 0)::Bool = False - (toEnum 5)::Bool = error "Prelude.Enum.Bool.toEnum: bad argument" - (fromEnum False) = 0 - (fromEnum True) = 1 - ([False ..]) = [False,True] - ([True ..]) = [True] - ([False,True ..]) = [False,True] - ([True,False ..]) = [True,False] - (take 7 ([False,False ..])) = [False,False,False,False,False,False,False] - (take 7 ([True,True ..])) = [True,True,True,True,True,True,True] - ([False .. True]) = [False,True] - ([True .. False]) = [] - take 7 ([False,False .. False]) = [False,False,False,False,False,False,False] - take 7 ([False,False .. True]) = [False,False,False,False,False,False,False] - take 7 ([False,True .. False]) = [False] - take 7 ([False,True .. True]) = [False,True] - take 7 ([True,False .. False]) = [True,False] - take 7 ([True,False .. True]) = [True] - take 7 ([True,True .. False]) = [] - take 7 ([True,True .. True]) = [True,True,True,True,True,True,True] -Testing Enum Rational: - (succ (0::Rational)) = 1 % 1 - (succ ((-1)::Rational)) = 0 % 1 - pred (1::Rational) = 0 % 1 - pred (0::Rational) = (-1) % 1 - (map (toEnum::Int->Rational) [1,minBound,maxBound]) = [1 % 1,(-9223372036854775808) % 1,9223372036854775807 % 1] - (map fromEnum [(1::Rational),42,45]) = [1,42,45] - (take 7 [(1::Rational)..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(-5::Rational)..]) = [(-5) % 1,(-4) % 1,(-3) % 1,(-2) % 1,(-1) % 1,0 % 1,1 % 1] - (take 7 [(1::Rational),2..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(1::Rational),7..]) = [1 % 1,7 % 1,13 % 1,19 % 1,25 % 1,31 % 1,37 % 1] - (take 7 [(1::Rational),1..]) = [1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1] - (take 7 [(1::Rational),0..]) = [1 % 1,0 % 1,(-1) % 1,(-2) % 1,(-3) % 1,(-4) % 1,(-5) % 1] - (take 7 [(5::Rational),2..]) = [5 % 1,2 % 1,(-1) % 1,(-4) % 1,(-7) % 1,(-10) % 1,(-13) % 1] - (take 7 ([(1::Rational) .. 5])) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1] - (take 4 ([(1::Rational) .. 1])) = [1 % 1] - (take 7 ([(1::Rational) .. 0])) = [] - (take 7 ([(5::Rational) .. 0])) = [] - (take 7 [(5::Rational),4..1]) = [5 % 1,4 % 1,3 % 1,2 % 1,1 % 1] - (take 7 [(5::Rational),3..1]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(5::Rational),3..2]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(1::Rational),2..1]) = [1 % 1] - (take 7 [(2::Rational),1..2]) = [2 % 1] - (take 7 [(2::Rational),1..1]) = [2 % 1,1 % 1] - (take 7 [(2::Rational),3..1]) = [] -Testing Enum (Ratio Int): - (succ (0::Ratio Int)) = 1 % 1 - (succ ((-1)::Ratio Int)) = 0 % 1 - pred (1::Ratio Int) = 0 % 1 - pred (0::Ratio Int) = (-1) % 1 - (map (toEnum::Int->Ratio Int) [1,minBound,maxBound]) = [1 % 1,(-9223372036854775808) % 1,9223372036854775807 % 1] - (map fromEnum [(1::Ratio Int),42,45]) = [1,42,45] - (take 7 [(1::Ratio Int)..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(-5::Ratio Int)..]) = [(-5) % 1,(-4) % 1,(-3) % 1,(-2) % 1,(-1) % 1,0 % 1,1 % 1] - (take 7 [((toEnum ((maxBound::Int)-5))::Ratio Int)..]) = [9223372036854775802 % 1,9223372036854775803 % 1,9223372036854775804 % 1,9223372036854775805 % 1,9223372036854775806 % 1,9223372036854775807 % 1,(-9223372036854775808) % 1] - (take 7 [(1::Ratio Int),2..]) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1,6 % 1,7 % 1] - (take 7 [(1::Ratio Int),7..]) = [1 % 1,7 % 1,13 % 1,19 % 1,25 % 1,31 % 1,37 % 1] - (take 7 [(1::Ratio Int),1..]) = [1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1,1 % 1] - (take 7 [(1::Ratio Int),0..]) = [1 % 1,0 % 1,(-1) % 1,(-2) % 1,(-3) % 1,(-4) % 1,(-5) % 1] - (take 7 [(5::Ratio Int),2..]) = [5 % 1,2 % 1,(-1) % 1,(-4) % 1,(-7) % 1,(-10) % 1,(-13) % 1] - (take 7 [x, x-1 ..]) = [(-9223372036854775807) % 1,(-9223372036854775808) % 1,9223372036854775807 % 1,9223372036854775806 % 1,9223372036854775805 % 1,9223372036854775804 % 1,9223372036854775803 % 1] - (take 7 [x, x-1 ..]) = [(-9223372036854775803) % 1,(-9223372036854775804) % 1,(-9223372036854775805) % 1,(-9223372036854775806) % 1,(-9223372036854775807) % 1,(-9223372036854775808) % 1,9223372036854775807 % 1] - (take 7 [x, (x+1) ..]) = [9223372036854775802 % 1,9223372036854775803 % 1,9223372036854775804 % 1,9223372036854775805 % 1,9223372036854775806 % 1,9223372036854775807 % 1,(-9223372036854775808) % 1] - (take 7 ([(1::Ratio Int) .. 5])) = [1 % 1,2 % 1,3 % 1,4 % 1,5 % 1] - (take 4 ([(1::Ratio Int) .. 1])) = [1 % 1] - (take 7 ([(1::Ratio Int) .. 0])) = [] - (take 7 ([(5::Ratio Int) .. 0])) = [] - (take 7 ([x..y])) = [9223372036854775802 % 1,9223372036854775803 % 1,9223372036854775804 % 1,9223372036854775805 % 1,9223372036854775806 % 1,9223372036854775807 % 1] - (take 7 ([x..y])) = [] - (take 7 [(5::Ratio Int),4..1]) = [5 % 1,4 % 1,3 % 1,2 % 1,1 % 1] - (take 7 [(5::Ratio Int),3..1]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(5::Ratio Int),3..2]) = [5 % 1,3 % 1,1 % 1] - (take 7 [(1::Ratio Int),2..1]) = [1 % 1] - (take 7 [(2::Ratio Int),1..2]) = [2 % 1] - (take 7 [(2::Ratio Int),1..1]) = [2 % 1,1 % 1] - (take 7 [(2::Ratio Int),3..1]) = [] - (take 7 [x,(x+1)..y]) = [9223372036854775803 % 1,9223372036854775804 % 1,9223372036854775805 % 1,9223372036854775806 % 1,9223372036854775807 % 1] - (take 7 [x,(x-1)..y]) = [(-9223372036854775803) % 1,(-9223372036854775804) % 1,(-9223372036854775805) % 1,(-9223372036854775806) % 1,(-9223372036854775807) % 1,(-9223372036854775808) % 1] diff --git a/testsuite/tests/lib/should_run/enum02.hs b/testsuite/tests/lib/should_run/enum02.hs deleted file mode 100644 index 3ba9d4912d..0000000000 --- a/testsuite/tests/lib/should_run/enum02.hs +++ /dev/null @@ -1,263 +0,0 @@ --- !!! Testing the Int Enum instances. -module Main(main) where - -import Control.Exception -import Prelude hiding (catch) -import Data.Int - -main = do - putStrLn "Testing Enum Int8:" - testEnumInt8 - putStrLn "Testing Enum Int16:" - testEnumInt16 - putStrLn "Testing Enum Int32:" - testEnumInt32 - putStrLn "Testing Enum Int64:" - testEnumInt64 - -#define printTest(x) (do{ putStr ( " " ++ "x" ++ " = " ) ; print (x) }) - -testEnumInt8 :: IO () -testEnumInt8 = do - -- succ - printTest ((succ (0::Int8))) - printTest ((succ (minBound::Int8))) - mayBomb (printTest ((succ (maxBound::Int8)))) - - -- pred - printTest (pred (1::Int8)) - printTest (pred (maxBound::Int8)) - mayBomb (printTest (pred (minBound::Int8))) - - -- toEnum - printTest ((map (toEnum::Int->Int8) [1, fromIntegral (minBound::Int8), fromIntegral (maxBound::Int8)])) - mayBomb (printTest ((toEnum (maxBound::Int))::Int8)) - - -- fromEnum - printTest ((map fromEnum [(1::Int8),minBound,maxBound])) - - -- [x..] aka enumFrom - printTest ((take 7 [(1::Int8)..])) - printTest ((take 7 [((maxBound::Int8)-5)..])) -- just in case it doesn't catch the upper bound.. - - -- [x,y..] aka enumFromThen - printTest ((take 7 [(1::Int8),2..])) - printTest ((take 7 [(1::Int8),7..])) - printTest ((take 7 [(1::Int8),1..])) - printTest ((take 7 [(1::Int8),0..])) - printTest ((take 7 [(5::Int8),2..])) - let x = (minBound::Int8) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Int8) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Int8) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Int8) .. 5]))) - printTest ((take 4 ([(1::Int8) .. 1]))) - printTest ((take 7 ([(1::Int8) .. 0]))) - printTest ((take 7 ([(5::Int8) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Int8)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Int8)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Int8),4..1])) - printTest ((take 7 [(5::Int8),3..1])) - printTest ((take 7 [(5::Int8),3..2])) - printTest ((take 7 [(1::Int8),2..1])) - printTest ((take 7 [(2::Int8),1..2])) - printTest ((take 7 [(2::Int8),1..1])) - printTest ((take 7 [(2::Int8),3..1])) - - let x = (maxBound::Int8) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Int8) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - -testEnumInt16 :: IO () -testEnumInt16 = do - -- succ - printTest ((succ (0::Int16))) - printTest ((succ (minBound::Int16))) - mayBomb (printTest ((succ (maxBound::Int16)))) - - -- pred - printTest (pred (1::Int16)) - printTest (pred (maxBound::Int16)) - mayBomb (printTest (pred (minBound::Int16))) - - -- toEnum - printTest ((map (toEnum::Int->Int16) [1, fromIntegral (minBound::Int16), fromIntegral (maxBound::Int16)])) - mayBomb (printTest ((toEnum (maxBound::Int))::Int16)) - - - -- fromEnum - printTest ((map fromEnum [(1::Int16),minBound,maxBound])) - - -- [x..] aka enumFrom - printTest ((take 7 [(1::Int16)..])) - printTest ((take 7 [((maxBound::Int16)-5)..])) -- just in case it doesn't catch the upper bound.. - - -- [x,y..] aka enumFromThen - printTest ((take 7 [(1::Int16),2..])) - printTest ((take 7 [(1::Int16),7..])) - printTest ((take 7 [(1::Int16),1..])) - printTest ((take 7 [(1::Int16),0..])) - printTest ((take 7 [(5::Int16),2..])) - let x = (minBound::Int16) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Int16) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Int16) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Int16) .. 5]))) - printTest ((take 4 ([(1::Int16) .. 1]))) - printTest ((take 7 ([(1::Int16) .. 0]))) - printTest ((take 7 ([(5::Int16) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Int16)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Int16)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Int16),4..1])) - printTest ((take 7 [(5::Int16),3..1])) - printTest ((take 7 [(5::Int16),3..2])) - printTest ((take 7 [(1::Int16),2..1])) - printTest ((take 7 [(2::Int16),1..2])) - printTest ((take 7 [(2::Int16),1..1])) - printTest ((take 7 [(2::Int16),3..1])) - - let x = (maxBound::Int16) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Int16) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - -testEnumInt32 :: IO () -testEnumInt32 = do - -- succ - printTest ((succ (0::Int32))) - printTest ((succ (minBound::Int32))) - mayBomb (printTest ((succ (maxBound::Int32)))) - - -- pred - printTest (pred (1::Int32)) - printTest (pred (maxBound::Int32)) - mayBomb (printTest (pred (minBound::Int32))) - - -- toEnum - printTest ((map (toEnum::Int->Int32) [1, fromIntegral (minBound::Int32), fromIntegral (maxBound::Int32)])) - mayBomb (printTest ((toEnum (maxBound::Int))::Int32)) - - -- fromEnum - printTest ((map fromEnum [(1::Int32),minBound,maxBound])) - - -- [x..] aka enumFrom - printTest ((take 7 [(1::Int32)..])) - printTest ((take 7 [((maxBound::Int32)-5)..])) -- just in case it doesn't catch the upper bound.. - - -- [x,y..] aka enumFromThen - printTest ((take 7 [(1::Int32),2..])) - printTest ((take 7 [(1::Int32),7..])) - printTest ((take 7 [(1::Int32),1..])) - printTest ((take 7 [(1::Int32),0..])) - printTest ((take 7 [(5::Int32),2..])) - let x = (minBound::Int32) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Int32) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Int32) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Int32) .. 5]))) - printTest ((take 4 ([(1::Int32) .. 1]))) - printTest ((take 7 ([(1::Int32) .. 0]))) - printTest ((take 7 ([(5::Int32) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Int32)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Int32)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Int32),4..1])) - printTest ((take 7 [(5::Int32),3..1])) - printTest ((take 7 [(5::Int32),3..2])) - printTest ((take 7 [(1::Int32),2..1])) - printTest ((take 7 [(2::Int32),1..2])) - printTest ((take 7 [(2::Int32),1..1])) - printTest ((take 7 [(2::Int32),3..1])) - - let x = (maxBound::Int32) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Int32) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - -testEnumInt64 :: IO () -testEnumInt64 = do - -- succ - printTest ((succ (0::Int64))) - printTest ((succ (minBound::Int64))) - mayBomb (printTest ((succ (maxBound::Int64)))) - - -- pred - printTest (pred (1::Int64)) - printTest (pred (maxBound::Int64)) - mayBomb (printTest (pred (minBound::Int64))) - - -- toEnum - mayBomb (printTest ((map (toEnum::Int->Int64) [1, fromIntegral (minBound::Int64), fromIntegral (maxBound::Int64)]))) - mayBomb (printTest ((toEnum (maxBound::Int))::Int64)) - - -- fromEnum - printTest ((map fromEnum [(1::Int64),fromIntegral (minBound::Int) ,fromIntegral (maxBound::Int)])) - mayBomb (printTest (fromEnum (maxBound::Int64))) - - -- [x..] aka enumFrom - printTest ((take 7 [(1::Int64)..])) - printTest ((take 7 [((maxBound::Int64)-5)..])) -- just in case it doesn't catch the upper bound.. - - -- [x,y..] aka enumFromThen - printTest ((take 7 [(1::Int64),2..])) - printTest ((take 7 [(1::Int64),7..])) - printTest ((take 7 [(1::Int64),1..])) - printTest ((take 7 [(1::Int64),0..])) - printTest ((take 7 [(5::Int64),2..])) - let x = (minBound::Int64) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Int64) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Int64) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Int64) .. 5]))) - printTest ((take 4 ([(1::Int64) .. 1]))) - printTest ((take 7 ([(1::Int64) .. 0]))) - printTest ((take 7 ([(5::Int64) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Int64)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Int64)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Int64),4..1])) - printTest ((take 7 [(5::Int64),3..1])) - printTest ((take 7 [(5::Int64),3..2])) - printTest ((take 7 [(1::Int64),2..1])) - printTest ((take 7 [(2::Int64),1..2])) - printTest ((take 7 [(2::Int64),1..1])) - printTest ((take 7 [(2::Int64),3..1])) - - let x = (maxBound::Int64) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Int64) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - - --- --- --- Utils --- --- - - -mayBomb x = catch x (\(ErrorCall e) -> putStrLn ("error " ++ show e)) - `catch` (\e -> putStrLn ("Fail: " ++ show (e :: SomeException))) diff --git a/testsuite/tests/lib/should_run/enum02.stdout b/testsuite/tests/lib/should_run/enum02.stdout deleted file mode 100644 index 06d3bb5cae..0000000000 --- a/testsuite/tests/lib/should_run/enum02.stdout +++ /dev/null @@ -1,141 +0,0 @@ -Testing Enum Int8: - (succ (0::Int8)) = 1 - (succ (minBound::Int8)) = -127 - (succ (maxBound::Int8)) = error "Enum.succ{Int8}: tried to take `succ' of maxBound" - pred (1::Int8) = 0 - pred (maxBound::Int8) = 126 - pred (minBound::Int8) = error "Enum.pred{Int8}: tried to take `pred' of minBound" - (map (toEnum::Int->Int8) [1, fromIntegral (minBound::Int8), fromIntegral (maxBound::Int8)]) = [1,-128,127] - (toEnum (maxBound::Int))::Int8 = error "Enum.toEnum{Int8}: tag (2147483647) is outside of bounds (-128,127)" - (map fromEnum [(1::Int8),minBound,maxBound]) = [1,-128,127] - (take 7 [(1::Int8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int8)-5)..]) = [122,123,124,125,126,127] - (take 7 [(1::Int8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int8),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int8),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-127,-128] - (take 7 [x, x-1 ..]) = [-123,-124,-125,-126,-127,-128] - (take 7 [x, (x+1) ..]) = [122,123,124,125,126,127] - (take 7 ([(1::Int8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int8) .. 1])) = [1] - (take 7 ([(1::Int8) .. 0])) = [] - (take 7 ([(5::Int8) .. 0])) = [] - (take 7 ([(maxBound-(5::Int8)) .. maxBound])) = [122,123,124,125,126,127] - (take 7 ([(minBound+(5::Int8)) .. minBound])) = [] - (take 7 [(5::Int8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int8),3..1]) = [5,3,1] - (take 7 [(5::Int8),3..2]) = [5,3] - (take 7 [(1::Int8),2..1]) = [1] - (take 7 [(2::Int8),1..2]) = [2] - (take 7 [(2::Int8),1..1]) = [2,1] - (take 7 [(2::Int8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [123,124,125,126,127] - (take 7 [x,(x-1)..minBound]) = [-123,-124,-125,-126,-127,-128] -Testing Enum Int16: - (succ (0::Int16)) = 1 - (succ (minBound::Int16)) = -32767 - (succ (maxBound::Int16)) = error "Enum.succ{Int16}: tried to take `succ' of maxBound" - pred (1::Int16) = 0 - pred (maxBound::Int16) = 32766 - pred (minBound::Int16) = error "Enum.pred{Int16}: tried to take `pred' of minBound" - (map (toEnum::Int->Int16) [1, fromIntegral (minBound::Int16), fromIntegral (maxBound::Int16)]) = [1,-32768,32767] - (toEnum (maxBound::Int))::Int16 = error "Enum.toEnum{Int16}: tag (2147483647) is outside of bounds (-32768,32767)" - (map fromEnum [(1::Int16),minBound,maxBound]) = [1,-32768,32767] - (take 7 [(1::Int16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int16)-5)..]) = [32762,32763,32764,32765,32766,32767] - (take 7 [(1::Int16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int16),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int16),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-32767,-32768] - (take 7 [x, x-1 ..]) = [-32763,-32764,-32765,-32766,-32767,-32768] - (take 7 [x, (x+1) ..]) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(1::Int16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int16) .. 1])) = [1] - (take 7 ([(1::Int16) .. 0])) = [] - (take 7 ([(5::Int16) .. 0])) = [] - (take 7 ([(maxBound-(5::Int16)) .. maxBound])) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(minBound+(5::Int16)) .. minBound])) = [] - (take 7 [(5::Int16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int16),3..1]) = [5,3,1] - (take 7 [(5::Int16),3..2]) = [5,3] - (take 7 [(1::Int16),2..1]) = [1] - (take 7 [(2::Int16),1..2]) = [2] - (take 7 [(2::Int16),1..1]) = [2,1] - (take 7 [(2::Int16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [32763,32764,32765,32766,32767] - (take 7 [x,(x-1)..minBound]) = [-32763,-32764,-32765,-32766,-32767,-32768] -Testing Enum Int32: - (succ (0::Int32)) = 1 - (succ (minBound::Int32)) = -2147483647 - (succ (maxBound::Int32)) = error "Enum.succ{Int32}: tried to take `succ' of maxBound" - pred (1::Int32) = 0 - pred (maxBound::Int32) = 2147483646 - pred (minBound::Int32) = error "Enum.pred{Int32}: tried to take `pred' of minBound" - (map (toEnum::Int->Int32) [1, fromIntegral (minBound::Int32), fromIntegral (maxBound::Int32)]) = [1,-2147483648,2147483647] - (toEnum (maxBound::Int))::Int32 = 2147483647 - (map fromEnum [(1::Int32),minBound,maxBound]) = [1,-2147483648,2147483647] - (take 7 [(1::Int32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int32)-5)..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [(1::Int32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int32),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int32),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-2147483647,-2147483648] - (take 7 [x, x-1 ..]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] - (take 7 [x, (x+1) ..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(1::Int32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int32) .. 1])) = [1] - (take 7 ([(1::Int32) .. 0])) = [] - (take 7 ([(5::Int32) .. 0])) = [] - (take 7 ([(maxBound-(5::Int32)) .. maxBound])) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(minBound+(5::Int32)) .. minBound])) = [] - (take 7 [(5::Int32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int32),3..1]) = [5,3,1] - (take 7 [(5::Int32),3..2]) = [5,3] - (take 7 [(1::Int32),2..1]) = [1] - (take 7 [(2::Int32),1..2]) = [2] - (take 7 [(2::Int32),1..1]) = [2,1] - (take 7 [(2::Int32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [x,(x-1)..minBound]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] -Testing Enum Int64: - (succ (0::Int64)) = 1 - (succ (minBound::Int64)) = -9223372036854775807 - (succ (maxBound::Int64)) = error "Enum.succ{Int64}: tried to take `succ' of maxBound" - pred (1::Int64) = 0 - pred (maxBound::Int64) = 9223372036854775806 - pred (minBound::Int64) = error "Enum.pred{Int64}: tried to take `pred' of minBound" - (map (toEnum::Int->Int64) [1, fromIntegral (minBound::Int64), fromIntegral (maxBound::Int64)]) = [1,0,-1] - (toEnum (maxBound::Int))::Int64 = 2147483647 - (map fromEnum [(1::Int64),fromIntegral (minBound::Int) ,fromIntegral (maxBound::Int)]) = [1,-2147483648,2147483647] - fromEnum (maxBound::Int64) = error "Enum.fromEnum{Int64}: value (9223372036854775807) is outside of Int's bounds (-2147483648,2147483647)" - (take 7 [(1::Int64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int64)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [(1::Int64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int64),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int64),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808] - (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] - (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(1::Int64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int64) .. 1])) = [1] - (take 7 ([(1::Int64) .. 0])) = [] - (take 7 ([(5::Int64) .. 0])) = [] - (take 7 ([(maxBound-(5::Int64)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(minBound+(5::Int64)) .. minBound])) = [] - (take 7 [(5::Int64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int64),3..1]) = [5,3,1] - (take 7 [(5::Int64),3..2]) = [5,3] - (take 7 [(1::Int64),2..1]) = [1] - (take 7 [(2::Int64),1..2]) = [2] - (take 7 [(2::Int64),1..1]) = [2,1] - (take 7 [(2::Int64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] diff --git a/testsuite/tests/lib/should_run/enum02.stdout-alpha-dec-osf3 b/testsuite/tests/lib/should_run/enum02.stdout-alpha-dec-osf3 deleted file mode 100644 index 23222450b5..0000000000 --- a/testsuite/tests/lib/should_run/enum02.stdout-alpha-dec-osf3 +++ /dev/null @@ -1,141 +0,0 @@ -Testing Enum Int8: - (succ (0::Int8)) = 1 - (succ (minBound::Int8)) = -127 - (succ (maxBound::Int8)) = error "Enum.succ{Int8}: tried to take `succ' of maxBound" - pred (1::Int8) = 0 - pred (maxBound::Int8) = 126 - pred (minBound::Int8) = error "Enum.pred{Int8}: tried to take `pred' of minBound" - (map (toEnum::Int->Int8) [1, toInt (minBound::Int8), toInt (maxBound::Int8)]) = [1,-128,127] - (toEnum (maxBound::Int))::Int8 = error "Enum.toEnum{Int8}: tag (9223372036854775807) is outside of bounds (-128,127)" - (map fromEnum [(1::Int8),minBound,maxBound]) = [1,-128,127] - (take 7 [(1::Int8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int8)-5)..]) = [122,123,124,125,126,127] - (take 7 [(1::Int8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int8),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int8),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-127,-128] - (take 7 [x, x-1 ..]) = [-123,-124,-125,-126,-127,-128] - (take 7 [x, (x+1) ..]) = [122,123,124,125,126,127] - (take 7 ([(1::Int8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int8) .. 1])) = [1] - (take 7 ([(1::Int8) .. 0])) = [] - (take 7 ([(5::Int8) .. 0])) = [] - (take 7 ([(maxBound-(5::Int8)) .. maxBound])) = [122,123,124,125,126,127] - (take 7 ([(minBound+(5::Int8)) .. minBound])) = [] - (take 7 [(5::Int8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int8),3..1]) = [5,3,1] - (take 7 [(5::Int8),3..2]) = [5,3] - (take 7 [(1::Int8),2..1]) = [1] - (take 7 [(2::Int8),1..2]) = [2] - (take 7 [(2::Int8),1..1]) = [2,1] - (take 7 [(2::Int8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [123,124,125,126,127] - (take 7 [x,(x-1)..minBound]) = [-123,-124,-125,-126,-127,-128] -Testing Enum Int16: - (succ (0::Int16)) = 1 - (succ (minBound::Int16)) = -32767 - (succ (maxBound::Int16)) = error "Enum.succ{Int16}: tried to take `succ' of maxBound" - pred (1::Int16) = 0 - pred (maxBound::Int16) = 32766 - pred (minBound::Int16) = error "Enum.pred{Int16}: tried to take `pred' of minBound" - (map (toEnum::Int->Int16) [1, toInt (minBound::Int16), toInt (maxBound::Int16)]) = [1,-32768,32767] - (toEnum (maxBound::Int))::Int16 = error "Enum.toEnum{Int16}: tag (9223372036854775807) is outside of bounds (-32768,32767)" - (map fromEnum [(1::Int16),minBound,maxBound]) = [1,-32768,32767] - (take 7 [(1::Int16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int16)-5)..]) = [32762,32763,32764,32765,32766,32767] - (take 7 [(1::Int16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int16),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int16),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-32767,-32768] - (take 7 [x, x-1 ..]) = [-32763,-32764,-32765,-32766,-32767,-32768] - (take 7 [x, (x+1) ..]) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(1::Int16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int16) .. 1])) = [1] - (take 7 ([(1::Int16) .. 0])) = [] - (take 7 ([(5::Int16) .. 0])) = [] - (take 7 ([(maxBound-(5::Int16)) .. maxBound])) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(minBound+(5::Int16)) .. minBound])) = [] - (take 7 [(5::Int16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int16),3..1]) = [5,3,1] - (take 7 [(5::Int16),3..2]) = [5,3] - (take 7 [(1::Int16),2..1]) = [1] - (take 7 [(2::Int16),1..2]) = [2] - (take 7 [(2::Int16),1..1]) = [2,1] - (take 7 [(2::Int16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [32763,32764,32765,32766,32767] - (take 7 [x,(x-1)..minBound]) = [-32763,-32764,-32765,-32766,-32767,-32768] -Testing Enum Int32: - (succ (0::Int32)) = 1 - (succ (minBound::Int32)) = -2147483647 - (succ (maxBound::Int32)) = error "Enum.succ{Int32}: tried to take `succ' of maxBound" - pred (1::Int32) = 0 - pred (maxBound::Int32) = 2147483646 - pred (minBound::Int32) = error "Enum.pred{Int32}: tried to take `pred' of minBound" - (map (toEnum::Int->Int32) [1, toInt (minBound::Int32), toInt (maxBound::Int32)]) = [1,-2147483648,2147483647] - (toEnum (maxBound::Int))::Int32 = error "Enum.toEnum{Int32}: tag (9223372036854775807) is outside of bounds (-2147483648,2147483647)" - (map fromEnum [(1::Int32),minBound,maxBound]) = [1,-2147483648,2147483647] - (take 7 [(1::Int32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int32)-5)..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [(1::Int32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int32),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int32),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-2147483647,-2147483648] - (take 7 [x, x-1 ..]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] - (take 7 [x, (x+1) ..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(1::Int32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int32) .. 1])) = [1] - (take 7 ([(1::Int32) .. 0])) = [] - (take 7 ([(5::Int32) .. 0])) = [] - (take 7 ([(maxBound-(5::Int32)) .. maxBound])) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(minBound+(5::Int32)) .. minBound])) = [] - (take 7 [(5::Int32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int32),3..1]) = [5,3,1] - (take 7 [(5::Int32),3..2]) = [5,3] - (take 7 [(1::Int32),2..1]) = [1] - (take 7 [(2::Int32),1..2]) = [2] - (take 7 [(2::Int32),1..1]) = [2,1] - (take 7 [(2::Int32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [x,(x-1)..minBound]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] -Testing Enum Int64: - (succ (0::Int64)) = 1 - (succ (minBound::Int64)) = -9223372036854775807 - (succ (maxBound::Int64)) = error "Enum.succ{Int64}: tried to take `succ' of maxBound" - pred (1::Int64) = 0 - pred (maxBound::Int64) = 9223372036854775806 - pred (minBound::Int64) = error "Enum.pred{Int64}: tried to take `pred' of minBound" - (map (toEnum::Int->Int64) [1, toInt (minBound::Int64), toInt (maxBound::Int64)]) = [1,-9223372036854775808,9223372036854775807] - (toEnum (maxBound::Int))::Int64 = 9223372036854775807 - (map fromEnum [(1::Int64),fromInt (minBound::Int) ,fromInt (maxBound::Int)]) = [1,-9223372036854775808,9223372036854775807] - fromEnum (maxBound::Int64) = 9223372036854775807 - (take 7 [(1::Int64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int64)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [(1::Int64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int64),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int64),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808] - (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] - (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(1::Int64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int64) .. 1])) = [1] - (take 7 ([(1::Int64) .. 0])) = [] - (take 7 ([(5::Int64) .. 0])) = [] - (take 7 ([(maxBound-(5::Int64)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(minBound+(5::Int64)) .. minBound])) = [] - (take 7 [(5::Int64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int64),3..1]) = [5,3,1] - (take 7 [(5::Int64),3..2]) = [5,3] - (take 7 [(1::Int64),2..1]) = [1] - (take 7 [(2::Int64),1..2]) = [2] - (take 7 [(2::Int64),1..1]) = [2,1] - (take 7 [(2::Int64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] diff --git a/testsuite/tests/lib/should_run/enum02.stdout-hugs b/testsuite/tests/lib/should_run/enum02.stdout-hugs deleted file mode 100644 index a28b84b187..0000000000 --- a/testsuite/tests/lib/should_run/enum02.stdout-hugs +++ /dev/null @@ -1,141 +0,0 @@ -Testing Enum Int8: - (succ (0::Int8)) = 1 - (succ (minBound::Int8)) = -127 - (succ (maxBound::Int8)) = error "succ: applied to maxBound" - pred (1::Int8) = 0 - pred (maxBound::Int8) = 126 - pred (minBound::Int8) = error "pred: applied to minBound" - (map (toEnum::Int->Int8) [1, fromIntegral (minBound::Int8), fromIntegral (maxBound::Int8)]) = [1,-128,127] - (toEnum (maxBound::Int))::Int8 = -1 - (map fromEnum [(1::Int8),minBound,maxBound]) = [1,-128,127] - (take 7 [(1::Int8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int8)-5)..]) = [122,123,124,125,126,127] - (take 7 [(1::Int8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int8),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int8),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-127,-128] - (take 7 [x, x-1 ..]) = [-123,-124,-125,-126,-127,-128] - (take 7 [x, (x+1) ..]) = [122,123,124,125,126,127] - (take 7 ([(1::Int8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int8) .. 1])) = [1] - (take 7 ([(1::Int8) .. 0])) = [] - (take 7 ([(5::Int8) .. 0])) = [] - (take 7 ([(maxBound-(5::Int8)) .. maxBound])) = [122,123,124,125,126,127] - (take 7 ([(minBound+(5::Int8)) .. minBound])) = [] - (take 7 [(5::Int8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int8),3..1]) = [5,3,1] - (take 7 [(5::Int8),3..2]) = [5,3] - (take 7 [(1::Int8),2..1]) = [1] - (take 7 [(2::Int8),1..2]) = [2] - (take 7 [(2::Int8),1..1]) = [2,1] - (take 7 [(2::Int8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [123,124,125,126,127] - (take 7 [x,(x-1)..minBound]) = [-123,-124,-125,-126,-127,-128] -Testing Enum Int16: - (succ (0::Int16)) = 1 - (succ (minBound::Int16)) = -32767 - (succ (maxBound::Int16)) = error "succ: applied to maxBound" - pred (1::Int16) = 0 - pred (maxBound::Int16) = 32766 - pred (minBound::Int16) = error "pred: applied to minBound" - (map (toEnum::Int->Int16) [1, fromIntegral (minBound::Int16), fromIntegral (maxBound::Int16)]) = [1,-32768,32767] - (toEnum (maxBound::Int))::Int16 = -1 - (map fromEnum [(1::Int16),minBound,maxBound]) = [1,-32768,32767] - (take 7 [(1::Int16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int16)-5)..]) = [32762,32763,32764,32765,32766,32767] - (take 7 [(1::Int16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int16),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int16),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-32767,-32768] - (take 7 [x, x-1 ..]) = [-32763,-32764,-32765,-32766,-32767,-32768] - (take 7 [x, (x+1) ..]) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(1::Int16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int16) .. 1])) = [1] - (take 7 ([(1::Int16) .. 0])) = [] - (take 7 ([(5::Int16) .. 0])) = [] - (take 7 ([(maxBound-(5::Int16)) .. maxBound])) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(minBound+(5::Int16)) .. minBound])) = [] - (take 7 [(5::Int16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int16),3..1]) = [5,3,1] - (take 7 [(5::Int16),3..2]) = [5,3] - (take 7 [(1::Int16),2..1]) = [1] - (take 7 [(2::Int16),1..2]) = [2] - (take 7 [(2::Int16),1..1]) = [2,1] - (take 7 [(2::Int16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [32763,32764,32765,32766,32767] - (take 7 [x,(x-1)..minBound]) = [-32763,-32764,-32765,-32766,-32767,-32768] -Testing Enum Int32: - (succ (0::Int32)) = 1 - (succ (minBound::Int32)) = -2147483647 - (succ (maxBound::Int32)) = error "succ: applied to maxBound" - pred (1::Int32) = 0 - pred (maxBound::Int32) = 2147483646 - pred (minBound::Int32) = error "pred: applied to minBound" - (map (toEnum::Int->Int32) [1, fromIntegral (minBound::Int32), fromIntegral (maxBound::Int32)]) = [1,-2147483648,2147483647] - (toEnum (maxBound::Int))::Int32 = 2147483647 - (map fromEnum [(1::Int32),minBound,maxBound]) = [1,-2147483648,2147483647] - (take 7 [(1::Int32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int32)-5)..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [(1::Int32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int32),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int32),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-2147483647,-2147483648] - (take 7 [x, x-1 ..]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] - (take 7 [x, (x+1) ..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(1::Int32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int32) .. 1])) = [1] - (take 7 ([(1::Int32) .. 0])) = [] - (take 7 ([(5::Int32) .. 0])) = [] - (take 7 ([(maxBound-(5::Int32)) .. maxBound])) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(minBound+(5::Int32)) .. minBound])) = [] - (take 7 [(5::Int32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int32),3..1]) = [5,3,1] - (take 7 [(5::Int32),3..2]) = [5,3] - (take 7 [(1::Int32),2..1]) = [1] - (take 7 [(2::Int32),1..2]) = [2] - (take 7 [(2::Int32),1..1]) = [2,1] - (take 7 [(2::Int32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [x,(x-1)..minBound]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] -Testing Enum Int64: - (succ (0::Int64)) = 1 - (succ (minBound::Int64)) = -9223372036854775807 - (succ (maxBound::Int64)) = error "succ: applied to maxBound" - pred (1::Int64) = 0 - pred (maxBound::Int64) = 9223372036854775806 - pred (minBound::Int64) = error "pred: applied to minBound" - (map (toEnum::Int->Int64) [1, fromIntegral (minBound::Int64), fromIntegral (maxBound::Int64)]) = [1,Fail: arithmetic overflow - (toEnum (maxBound::Int))::Int64 = 2147483647 - (map fromEnum [(1::Int64),fromIntegral (minBound::Int) ,fromIntegral (maxBound::Int)]) = [1,-2147483648,2147483647] - fromEnum (maxBound::Int64) = Fail: arithmetic overflow - (take 7 [(1::Int64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int64)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [(1::Int64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int64),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int64),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808] - (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] - (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(1::Int64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int64) .. 1])) = [1] - (take 7 ([(1::Int64) .. 0])) = [] - (take 7 ([(5::Int64) .. 0])) = [] - (take 7 ([(maxBound-(5::Int64)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(minBound+(5::Int64)) .. minBound])) = [] - (take 7 [(5::Int64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int64),3..1]) = [5,3,1] - (take 7 [(5::Int64),3..2]) = [5,3] - (take 7 [(1::Int64),2..1]) = [1] - (take 7 [(2::Int64),1..2]) = [2] - (take 7 [(2::Int64),1..1]) = [2,1] - (take 7 [(2::Int64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] diff --git a/testsuite/tests/lib/should_run/enum02.stdout-mips-sgi-irix b/testsuite/tests/lib/should_run/enum02.stdout-mips-sgi-irix deleted file mode 100644 index 3177d541f4..0000000000 --- a/testsuite/tests/lib/should_run/enum02.stdout-mips-sgi-irix +++ /dev/null @@ -1,141 +0,0 @@ -Testing Enum Int8: - (succ (0::Int8)) = 1 - (succ (minBound::Int8)) = -127 - (succ (maxBound::Int8)) = error "Enum.succ{Int8}: tried to take `succ' of maxBound" - pred (1::Int8) = 0 - pred (maxBound::Int8) = 126 - pred (minBound::Int8) = error "Enum.pred{Int8}: tried to take `pred' of minBound" - (map (toEnum::Int->Int8) [1, fromIntegral (minBound::Int8), fromIntegral (maxBound::Int8)]) = [1,-128,127] - (toEnum (maxBound::Int))::Int8 = error "Enum.toEnum{Int8}: tag (9223372036854775807) is outside of bounds (-128,127)" - (map fromEnum [(1::Int8),minBound,maxBound]) = [1,-128,127] - (take 7 [(1::Int8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int8)-5)..]) = [122,123,124,125,126,127] - (take 7 [(1::Int8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int8),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int8),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-127,-128] - (take 7 [x, x-1 ..]) = [-123,-124,-125,-126,-127,-128] - (take 7 [x, (x+1) ..]) = [122,123,124,125,126,127] - (take 7 ([(1::Int8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int8) .. 1])) = [1] - (take 7 ([(1::Int8) .. 0])) = [] - (take 7 ([(5::Int8) .. 0])) = [] - (take 7 ([(maxBound-(5::Int8)) .. maxBound])) = [122,123,124,125,126,127] - (take 7 ([(minBound+(5::Int8)) .. minBound])) = [] - (take 7 [(5::Int8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int8),3..1]) = [5,3,1] - (take 7 [(5::Int8),3..2]) = [5,3] - (take 7 [(1::Int8),2..1]) = [1] - (take 7 [(2::Int8),1..2]) = [2] - (take 7 [(2::Int8),1..1]) = [2,1] - (take 7 [(2::Int8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [123,124,125,126,127] - (take 7 [x,(x-1)..minBound]) = [-123,-124,-125,-126,-127,-128] -Testing Enum Int16: - (succ (0::Int16)) = 1 - (succ (minBound::Int16)) = -32767 - (succ (maxBound::Int16)) = error "Enum.succ{Int16}: tried to take `succ' of maxBound" - pred (1::Int16) = 0 - pred (maxBound::Int16) = 32766 - pred (minBound::Int16) = error "Enum.pred{Int16}: tried to take `pred' of minBound" - (map (toEnum::Int->Int16) [1, fromIntegral (minBound::Int16), fromIntegral (maxBound::Int16)]) = [1,-32768,32767] - (toEnum (maxBound::Int))::Int16 = error "Enum.toEnum{Int16}: tag (9223372036854775807) is outside of bounds (-32768,32767)" - (map fromEnum [(1::Int16),minBound,maxBound]) = [1,-32768,32767] - (take 7 [(1::Int16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int16)-5)..]) = [32762,32763,32764,32765,32766,32767] - (take 7 [(1::Int16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int16),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int16),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-32767,-32768] - (take 7 [x, x-1 ..]) = [-32763,-32764,-32765,-32766,-32767,-32768] - (take 7 [x, (x+1) ..]) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(1::Int16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int16) .. 1])) = [1] - (take 7 ([(1::Int16) .. 0])) = [] - (take 7 ([(5::Int16) .. 0])) = [] - (take 7 ([(maxBound-(5::Int16)) .. maxBound])) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(minBound+(5::Int16)) .. minBound])) = [] - (take 7 [(5::Int16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int16),3..1]) = [5,3,1] - (take 7 [(5::Int16),3..2]) = [5,3] - (take 7 [(1::Int16),2..1]) = [1] - (take 7 [(2::Int16),1..2]) = [2] - (take 7 [(2::Int16),1..1]) = [2,1] - (take 7 [(2::Int16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [32763,32764,32765,32766,32767] - (take 7 [x,(x-1)..minBound]) = [-32763,-32764,-32765,-32766,-32767,-32768] -Testing Enum Int32: - (succ (0::Int32)) = 1 - (succ (minBound::Int32)) = -2147483647 - (succ (maxBound::Int32)) = error "Enum.succ{Int32}: tried to take `succ' of maxBound" - pred (1::Int32) = 0 - pred (maxBound::Int32) = 2147483646 - pred (minBound::Int32) = error "Enum.pred{Int32}: tried to take `pred' of minBound" - (map (toEnum::Int->Int32) [1, fromIntegral (minBound::Int32), fromIntegral (maxBound::Int32)]) = [1,-2147483648,2147483647] - (toEnum (maxBound::Int))::Int32 = error "Enum.toEnum{Int32}: tag (9223372036854775807) is outside of bounds (-2147483648,2147483647)" - (map fromEnum [(1::Int32),minBound,maxBound]) = [1,-2147483648,2147483647] - (take 7 [(1::Int32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int32)-5)..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [(1::Int32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int32),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int32),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-2147483647,-2147483648] - (take 7 [x, x-1 ..]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] - (take 7 [x, (x+1) ..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(1::Int32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int32) .. 1])) = [1] - (take 7 ([(1::Int32) .. 0])) = [] - (take 7 ([(5::Int32) .. 0])) = [] - (take 7 ([(maxBound-(5::Int32)) .. maxBound])) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(minBound+(5::Int32)) .. minBound])) = [] - (take 7 [(5::Int32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int32),3..1]) = [5,3,1] - (take 7 [(5::Int32),3..2]) = [5,3] - (take 7 [(1::Int32),2..1]) = [1] - (take 7 [(2::Int32),1..2]) = [2] - (take 7 [(2::Int32),1..1]) = [2,1] - (take 7 [(2::Int32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [x,(x-1)..minBound]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] -Testing Enum Int64: - (succ (0::Int64)) = 1 - (succ (minBound::Int64)) = -9223372036854775807 - (succ (maxBound::Int64)) = error "Enum.succ{Int64}: tried to take `succ' of maxBound" - pred (1::Int64) = 0 - pred (maxBound::Int64) = 9223372036854775806 - pred (minBound::Int64) = error "Enum.pred{Int64}: tried to take `pred' of minBound" - (map (toEnum::Int->Int64) [1, fromIntegral (minBound::Int64), fromIntegral (maxBound::Int64)]) = [1,-9223372036854775808,9223372036854775807] - (toEnum (maxBound::Int))::Int64 = 9223372036854775807 - (map fromEnum [(1::Int64),fromIntegral (minBound::Int) ,fromIntegral (maxBound::Int)]) = [1,-9223372036854775808,9223372036854775807] - fromEnum (maxBound::Int64) = 9223372036854775807 - (take 7 [(1::Int64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int64)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [(1::Int64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int64),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int64),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808] - (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] - (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(1::Int64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int64) .. 1])) = [1] - (take 7 ([(1::Int64) .. 0])) = [] - (take 7 ([(5::Int64) .. 0])) = [] - (take 7 ([(maxBound-(5::Int64)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(minBound+(5::Int64)) .. minBound])) = [] - (take 7 [(5::Int64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int64),3..1]) = [5,3,1] - (take 7 [(5::Int64),3..2]) = [5,3] - (take 7 [(1::Int64),2..1]) = [1] - (take 7 [(2::Int64),1..2]) = [2] - (take 7 [(2::Int64),1..1]) = [2,1] - (take 7 [(2::Int64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] diff --git a/testsuite/tests/lib/should_run/enum02.stdout-ws-64 b/testsuite/tests/lib/should_run/enum02.stdout-ws-64 deleted file mode 100644 index 3177d541f4..0000000000 --- a/testsuite/tests/lib/should_run/enum02.stdout-ws-64 +++ /dev/null @@ -1,141 +0,0 @@ -Testing Enum Int8: - (succ (0::Int8)) = 1 - (succ (minBound::Int8)) = -127 - (succ (maxBound::Int8)) = error "Enum.succ{Int8}: tried to take `succ' of maxBound" - pred (1::Int8) = 0 - pred (maxBound::Int8) = 126 - pred (minBound::Int8) = error "Enum.pred{Int8}: tried to take `pred' of minBound" - (map (toEnum::Int->Int8) [1, fromIntegral (minBound::Int8), fromIntegral (maxBound::Int8)]) = [1,-128,127] - (toEnum (maxBound::Int))::Int8 = error "Enum.toEnum{Int8}: tag (9223372036854775807) is outside of bounds (-128,127)" - (map fromEnum [(1::Int8),minBound,maxBound]) = [1,-128,127] - (take 7 [(1::Int8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int8)-5)..]) = [122,123,124,125,126,127] - (take 7 [(1::Int8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int8),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int8),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-127,-128] - (take 7 [x, x-1 ..]) = [-123,-124,-125,-126,-127,-128] - (take 7 [x, (x+1) ..]) = [122,123,124,125,126,127] - (take 7 ([(1::Int8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int8) .. 1])) = [1] - (take 7 ([(1::Int8) .. 0])) = [] - (take 7 ([(5::Int8) .. 0])) = [] - (take 7 ([(maxBound-(5::Int8)) .. maxBound])) = [122,123,124,125,126,127] - (take 7 ([(minBound+(5::Int8)) .. minBound])) = [] - (take 7 [(5::Int8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int8),3..1]) = [5,3,1] - (take 7 [(5::Int8),3..2]) = [5,3] - (take 7 [(1::Int8),2..1]) = [1] - (take 7 [(2::Int8),1..2]) = [2] - (take 7 [(2::Int8),1..1]) = [2,1] - (take 7 [(2::Int8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [123,124,125,126,127] - (take 7 [x,(x-1)..minBound]) = [-123,-124,-125,-126,-127,-128] -Testing Enum Int16: - (succ (0::Int16)) = 1 - (succ (minBound::Int16)) = -32767 - (succ (maxBound::Int16)) = error "Enum.succ{Int16}: tried to take `succ' of maxBound" - pred (1::Int16) = 0 - pred (maxBound::Int16) = 32766 - pred (minBound::Int16) = error "Enum.pred{Int16}: tried to take `pred' of minBound" - (map (toEnum::Int->Int16) [1, fromIntegral (minBound::Int16), fromIntegral (maxBound::Int16)]) = [1,-32768,32767] - (toEnum (maxBound::Int))::Int16 = error "Enum.toEnum{Int16}: tag (9223372036854775807) is outside of bounds (-32768,32767)" - (map fromEnum [(1::Int16),minBound,maxBound]) = [1,-32768,32767] - (take 7 [(1::Int16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int16)-5)..]) = [32762,32763,32764,32765,32766,32767] - (take 7 [(1::Int16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int16),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int16),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-32767,-32768] - (take 7 [x, x-1 ..]) = [-32763,-32764,-32765,-32766,-32767,-32768] - (take 7 [x, (x+1) ..]) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(1::Int16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int16) .. 1])) = [1] - (take 7 ([(1::Int16) .. 0])) = [] - (take 7 ([(5::Int16) .. 0])) = [] - (take 7 ([(maxBound-(5::Int16)) .. maxBound])) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(minBound+(5::Int16)) .. minBound])) = [] - (take 7 [(5::Int16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int16),3..1]) = [5,3,1] - (take 7 [(5::Int16),3..2]) = [5,3] - (take 7 [(1::Int16),2..1]) = [1] - (take 7 [(2::Int16),1..2]) = [2] - (take 7 [(2::Int16),1..1]) = [2,1] - (take 7 [(2::Int16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [32763,32764,32765,32766,32767] - (take 7 [x,(x-1)..minBound]) = [-32763,-32764,-32765,-32766,-32767,-32768] -Testing Enum Int32: - (succ (0::Int32)) = 1 - (succ (minBound::Int32)) = -2147483647 - (succ (maxBound::Int32)) = error "Enum.succ{Int32}: tried to take `succ' of maxBound" - pred (1::Int32) = 0 - pred (maxBound::Int32) = 2147483646 - pred (minBound::Int32) = error "Enum.pred{Int32}: tried to take `pred' of minBound" - (map (toEnum::Int->Int32) [1, fromIntegral (minBound::Int32), fromIntegral (maxBound::Int32)]) = [1,-2147483648,2147483647] - (toEnum (maxBound::Int))::Int32 = error "Enum.toEnum{Int32}: tag (9223372036854775807) is outside of bounds (-2147483648,2147483647)" - (map fromEnum [(1::Int32),minBound,maxBound]) = [1,-2147483648,2147483647] - (take 7 [(1::Int32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int32)-5)..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [(1::Int32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int32),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int32),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-2147483647,-2147483648] - (take 7 [x, x-1 ..]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] - (take 7 [x, (x+1) ..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(1::Int32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int32) .. 1])) = [1] - (take 7 ([(1::Int32) .. 0])) = [] - (take 7 ([(5::Int32) .. 0])) = [] - (take 7 ([(maxBound-(5::Int32)) .. maxBound])) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(minBound+(5::Int32)) .. minBound])) = [] - (take 7 [(5::Int32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int32),3..1]) = [5,3,1] - (take 7 [(5::Int32),3..2]) = [5,3] - (take 7 [(1::Int32),2..1]) = [1] - (take 7 [(2::Int32),1..2]) = [2] - (take 7 [(2::Int32),1..1]) = [2,1] - (take 7 [(2::Int32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [x,(x-1)..minBound]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] -Testing Enum Int64: - (succ (0::Int64)) = 1 - (succ (minBound::Int64)) = -9223372036854775807 - (succ (maxBound::Int64)) = error "Enum.succ{Int64}: tried to take `succ' of maxBound" - pred (1::Int64) = 0 - pred (maxBound::Int64) = 9223372036854775806 - pred (minBound::Int64) = error "Enum.pred{Int64}: tried to take `pred' of minBound" - (map (toEnum::Int->Int64) [1, fromIntegral (minBound::Int64), fromIntegral (maxBound::Int64)]) = [1,-9223372036854775808,9223372036854775807] - (toEnum (maxBound::Int))::Int64 = 9223372036854775807 - (map fromEnum [(1::Int64),fromIntegral (minBound::Int) ,fromIntegral (maxBound::Int)]) = [1,-9223372036854775808,9223372036854775807] - fromEnum (maxBound::Int64) = 9223372036854775807 - (take 7 [(1::Int64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int64)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [(1::Int64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int64),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int64),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808] - (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] - (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(1::Int64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int64) .. 1])) = [1] - (take 7 ([(1::Int64) .. 0])) = [] - (take 7 ([(5::Int64) .. 0])) = [] - (take 7 ([(maxBound-(5::Int64)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(minBound+(5::Int64)) .. minBound])) = [] - (take 7 [(5::Int64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int64),3..1]) = [5,3,1] - (take 7 [(5::Int64),3..2]) = [5,3] - (take 7 [(1::Int64),2..1]) = [1] - (take 7 [(2::Int64),1..2]) = [2] - (take 7 [(2::Int64),1..1]) = [2,1] - (take 7 [(2::Int64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] diff --git a/testsuite/tests/lib/should_run/enum02.stdout-x86_64-unknown-openbsd b/testsuite/tests/lib/should_run/enum02.stdout-x86_64-unknown-openbsd deleted file mode 100644 index 3177d541f4..0000000000 --- a/testsuite/tests/lib/should_run/enum02.stdout-x86_64-unknown-openbsd +++ /dev/null @@ -1,141 +0,0 @@ -Testing Enum Int8: - (succ (0::Int8)) = 1 - (succ (minBound::Int8)) = -127 - (succ (maxBound::Int8)) = error "Enum.succ{Int8}: tried to take `succ' of maxBound" - pred (1::Int8) = 0 - pred (maxBound::Int8) = 126 - pred (minBound::Int8) = error "Enum.pred{Int8}: tried to take `pred' of minBound" - (map (toEnum::Int->Int8) [1, fromIntegral (minBound::Int8), fromIntegral (maxBound::Int8)]) = [1,-128,127] - (toEnum (maxBound::Int))::Int8 = error "Enum.toEnum{Int8}: tag (9223372036854775807) is outside of bounds (-128,127)" - (map fromEnum [(1::Int8),minBound,maxBound]) = [1,-128,127] - (take 7 [(1::Int8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int8)-5)..]) = [122,123,124,125,126,127] - (take 7 [(1::Int8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int8),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int8),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-127,-128] - (take 7 [x, x-1 ..]) = [-123,-124,-125,-126,-127,-128] - (take 7 [x, (x+1) ..]) = [122,123,124,125,126,127] - (take 7 ([(1::Int8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int8) .. 1])) = [1] - (take 7 ([(1::Int8) .. 0])) = [] - (take 7 ([(5::Int8) .. 0])) = [] - (take 7 ([(maxBound-(5::Int8)) .. maxBound])) = [122,123,124,125,126,127] - (take 7 ([(minBound+(5::Int8)) .. minBound])) = [] - (take 7 [(5::Int8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int8),3..1]) = [5,3,1] - (take 7 [(5::Int8),3..2]) = [5,3] - (take 7 [(1::Int8),2..1]) = [1] - (take 7 [(2::Int8),1..2]) = [2] - (take 7 [(2::Int8),1..1]) = [2,1] - (take 7 [(2::Int8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [123,124,125,126,127] - (take 7 [x,(x-1)..minBound]) = [-123,-124,-125,-126,-127,-128] -Testing Enum Int16: - (succ (0::Int16)) = 1 - (succ (minBound::Int16)) = -32767 - (succ (maxBound::Int16)) = error "Enum.succ{Int16}: tried to take `succ' of maxBound" - pred (1::Int16) = 0 - pred (maxBound::Int16) = 32766 - pred (minBound::Int16) = error "Enum.pred{Int16}: tried to take `pred' of minBound" - (map (toEnum::Int->Int16) [1, fromIntegral (minBound::Int16), fromIntegral (maxBound::Int16)]) = [1,-32768,32767] - (toEnum (maxBound::Int))::Int16 = error "Enum.toEnum{Int16}: tag (9223372036854775807) is outside of bounds (-32768,32767)" - (map fromEnum [(1::Int16),minBound,maxBound]) = [1,-32768,32767] - (take 7 [(1::Int16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int16)-5)..]) = [32762,32763,32764,32765,32766,32767] - (take 7 [(1::Int16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int16),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int16),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-32767,-32768] - (take 7 [x, x-1 ..]) = [-32763,-32764,-32765,-32766,-32767,-32768] - (take 7 [x, (x+1) ..]) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(1::Int16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int16) .. 1])) = [1] - (take 7 ([(1::Int16) .. 0])) = [] - (take 7 ([(5::Int16) .. 0])) = [] - (take 7 ([(maxBound-(5::Int16)) .. maxBound])) = [32762,32763,32764,32765,32766,32767] - (take 7 ([(minBound+(5::Int16)) .. minBound])) = [] - (take 7 [(5::Int16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int16),3..1]) = [5,3,1] - (take 7 [(5::Int16),3..2]) = [5,3] - (take 7 [(1::Int16),2..1]) = [1] - (take 7 [(2::Int16),1..2]) = [2] - (take 7 [(2::Int16),1..1]) = [2,1] - (take 7 [(2::Int16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [32763,32764,32765,32766,32767] - (take 7 [x,(x-1)..minBound]) = [-32763,-32764,-32765,-32766,-32767,-32768] -Testing Enum Int32: - (succ (0::Int32)) = 1 - (succ (minBound::Int32)) = -2147483647 - (succ (maxBound::Int32)) = error "Enum.succ{Int32}: tried to take `succ' of maxBound" - pred (1::Int32) = 0 - pred (maxBound::Int32) = 2147483646 - pred (minBound::Int32) = error "Enum.pred{Int32}: tried to take `pred' of minBound" - (map (toEnum::Int->Int32) [1, fromIntegral (minBound::Int32), fromIntegral (maxBound::Int32)]) = [1,-2147483648,2147483647] - (toEnum (maxBound::Int))::Int32 = error "Enum.toEnum{Int32}: tag (9223372036854775807) is outside of bounds (-2147483648,2147483647)" - (map fromEnum [(1::Int32),minBound,maxBound]) = [1,-2147483648,2147483647] - (take 7 [(1::Int32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int32)-5)..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [(1::Int32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int32),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int32),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-2147483647,-2147483648] - (take 7 [x, x-1 ..]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] - (take 7 [x, (x+1) ..]) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(1::Int32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int32) .. 1])) = [1] - (take 7 ([(1::Int32) .. 0])) = [] - (take 7 ([(5::Int32) .. 0])) = [] - (take 7 ([(maxBound-(5::Int32)) .. maxBound])) = [2147483642,2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 ([(minBound+(5::Int32)) .. minBound])) = [] - (take 7 [(5::Int32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int32),3..1]) = [5,3,1] - (take 7 [(5::Int32),3..2]) = [5,3] - (take 7 [(1::Int32),2..1]) = [1] - (take 7 [(2::Int32),1..2]) = [2] - (take 7 [(2::Int32),1..1]) = [2,1] - (take 7 [(2::Int32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [2147483643,2147483644,2147483645,2147483646,2147483647] - (take 7 [x,(x-1)..minBound]) = [-2147483643,-2147483644,-2147483645,-2147483646,-2147483647,-2147483648] -Testing Enum Int64: - (succ (0::Int64)) = 1 - (succ (minBound::Int64)) = -9223372036854775807 - (succ (maxBound::Int64)) = error "Enum.succ{Int64}: tried to take `succ' of maxBound" - pred (1::Int64) = 0 - pred (maxBound::Int64) = 9223372036854775806 - pred (minBound::Int64) = error "Enum.pred{Int64}: tried to take `pred' of minBound" - (map (toEnum::Int->Int64) [1, fromIntegral (minBound::Int64), fromIntegral (maxBound::Int64)]) = [1,-9223372036854775808,9223372036854775807] - (toEnum (maxBound::Int))::Int64 = 9223372036854775807 - (map fromEnum [(1::Int64),fromIntegral (minBound::Int) ,fromIntegral (maxBound::Int)]) = [1,-9223372036854775808,9223372036854775807] - fromEnum (maxBound::Int64) = 9223372036854775807 - (take 7 [(1::Int64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Int64)-5)..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [(1::Int64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Int64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Int64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Int64),0..]) = [1,0,-1,-2,-3,-4,-5] - (take 7 [(5::Int64),2..]) = [5,2,-1,-4,-7,-10,-13] - (take 7 [x, x-1 ..]) = [-9223372036854775807,-9223372036854775808] - (take 7 [x, x-1 ..]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] - (take 7 [x, (x+1) ..]) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(1::Int64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Int64) .. 1])) = [1] - (take 7 ([(1::Int64) .. 0])) = [] - (take 7 ([(5::Int64) .. 0])) = [] - (take 7 ([(maxBound-(5::Int64)) .. maxBound])) = [9223372036854775802,9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 ([(minBound+(5::Int64)) .. minBound])) = [] - (take 7 [(5::Int64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Int64),3..1]) = [5,3,1] - (take 7 [(5::Int64),3..2]) = [5,3] - (take 7 [(1::Int64),2..1]) = [1] - (take 7 [(2::Int64),1..2]) = [2] - (take 7 [(2::Int64),1..1]) = [2,1] - (take 7 [(2::Int64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [9223372036854775803,9223372036854775804,9223372036854775805,9223372036854775806,9223372036854775807] - (take 7 [x,(x-1)..minBound]) = [-9223372036854775803,-9223372036854775804,-9223372036854775805,-9223372036854775806,-9223372036854775807,-9223372036854775808] diff --git a/testsuite/tests/lib/should_run/enum03.hs b/testsuite/tests/lib/should_run/enum03.hs deleted file mode 100644 index 908f3dd1a0..0000000000 --- a/testsuite/tests/lib/should_run/enum03.hs +++ /dev/null @@ -1,266 +0,0 @@ --- !!! Testing the Word Enum instances. -module Main(main) where - -import Prelude hiding (catch) -import Control.Exception -import Data.Word -import Data.Int - -main = do - putStrLn "Testing Enum Word8:" - testEnumWord8 - putStrLn "Testing Enum Word16:" - testEnumWord16 - putStrLn "Testing Enum Word32:" - testEnumWord32 - putStrLn "Testing Enum Word64:" - testEnumWord64 - - -#define printTest(x) (do{ putStr ( " " ++ "x" ++ " = " ) ; print (x) }) - -testEnumWord8 :: IO () -testEnumWord8 = do - -- succ - printTest ((succ (0::Word8))) - printTest ((succ (minBound::Word8))) - mayBomb (printTest ((succ (maxBound::Word8)))) - - -- pred - printTest (pred (1::Word8)) - printTest (pred (maxBound::Word8)) - mayBomb (printTest (pred (minBound::Word8))) - - -- toEnum - printTest ((map (toEnum::Int->Word8) [1, fromIntegral (minBound::Word8)::Int, fromIntegral (maxBound::Word8)::Int])) - mayBomb (printTest ((toEnum (maxBound::Int))::Word8)) - - -- fromEnum - printTest ((map fromEnum [(1::Word8),minBound,maxBound])) - - -- [x..] aka enumFrom - printTest ((take 7 [(1::Word8)..])) - printTest ((take 7 [((maxBound::Word8)-5)..])) -- just in case it doesn't catch the upper bound.. - - -- [x,y..] aka enumFromThen - printTest ((take 7 [(1::Word8),2..])) - printTest ((take 7 [(1::Word8),7..])) - printTest ((take 7 [(1::Word8),1..])) - printTest ((take 7 [(1::Word8),0..])) - printTest ((take 7 [(5::Word8),2..])) - let x = (minBound::Word8) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Word8) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Word8) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Word8) .. 5]))) - printTest ((take 4 ([(1::Word8) .. 1]))) - printTest ((take 7 ([(1::Word8) .. 0]))) - printTest ((take 7 ([(5::Word8) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Word8)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Word8)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Word8),4..1])) - printTest ((take 7 [(5::Word8),3..1])) - printTest ((take 7 [(5::Word8),3..2])) - printTest ((take 7 [(1::Word8),2..1])) - printTest ((take 7 [(2::Word8),1..2])) - printTest ((take 7 [(2::Word8),1..1])) - printTest ((take 7 [(2::Word8),3..1])) - - let x = (maxBound::Word8) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Word8) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - -testEnumWord16 :: IO () -testEnumWord16 = do - -- succ - printTest ((succ (0::Word16))) - printTest ((succ (minBound::Word16))) - mayBomb (printTest ((succ (maxBound::Word16)))) - - -- pred - printTest (pred (1::Word16)) - printTest (pred (maxBound::Word16)) - mayBomb (printTest (pred (minBound::Word16))) - - -- toEnum - printTest ((map (toEnum::Int->Word16) [1, fromIntegral (minBound::Word16)::Int, fromIntegral (maxBound::Word16)::Int])) - mayBomb (printTest ((toEnum (maxBound::Int))::Word16)) - - - -- fromEnum - printTest ((map fromEnum [(1::Word16),minBound,maxBound])) - - -- [x..] aka enumFrom - printTest ((take 7 [(1::Word16)..])) - printTest ((take 7 [((maxBound::Word16)-5)..])) -- just in case it doesn't catch the upper bound.. - - -- [x,y..] aka enumFromThen - printTest ((take 7 [(1::Word16),2..])) - printTest ((take 7 [(1::Word16),7..])) - printTest ((take 7 [(1::Word16),1..])) - printTest ((take 7 [(1::Word16),0..])) - printTest ((take 7 [(5::Word16),2..])) - let x = (minBound::Word16) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Word16) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Word16) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Word16) .. 5]))) - printTest ((take 4 ([(1::Word16) .. 1]))) - printTest ((take 7 ([(1::Word16) .. 0]))) - printTest ((take 7 ([(5::Word16) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Word16)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Word16)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Word16),4..1])) - printTest ((take 7 [(5::Word16),3..1])) - printTest ((take 7 [(5::Word16),3..2])) - printTest ((take 7 [(1::Word16),2..1])) - printTest ((take 7 [(2::Word16),1..2])) - printTest ((take 7 [(2::Word16),1..1])) - printTest ((take 7 [(2::Word16),3..1])) - - let x = (maxBound::Word16) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Word16) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - -testEnumWord32 :: IO () -testEnumWord32 = do - -- succ - printTest ((succ (0::Word32))) - printTest ((succ (minBound::Word32))) - mayBomb (printTest ((succ (maxBound::Word32)))) - - -- pred - printTest (pred (1::Word32)) - printTest (pred (maxBound::Word32)) - mayBomb (printTest (pred (minBound::Word32))) - - -- toEnum - printTest ((map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int])) - mayBomb (printTest ((toEnum (maxBound::Int))::Word32)) - - -- fromEnum - printTest ((map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)])) - mayBomb (printTest (fromEnum (maxBound::Word32))) - - -- [x..] aka enumFrom - printTest ((take 7 [(1::Word32)..])) - printTest ((take 7 [((maxBound::Word32)-5)..])) -- just in case it doesn't catch the upper bound.. - - -- [x,y..] aka enumFromThen - printTest ((take 7 [(1::Word32),2..])) - printTest ((take 7 [(1::Word32),7..])) - printTest ((take 7 [(1::Word32),1..])) - printTest ((take 7 [(1::Word32),0..])) - printTest ((take 7 [(5::Word32),2..])) - let x = (minBound::Word32) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Word32) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Word32) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Word32) .. 5]))) - printTest ((take 4 ([(1::Word32) .. 1]))) - printTest ((take 7 ([(1::Word32) .. 0]))) - printTest ((take 7 ([(5::Word32) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Word32)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Word32)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Word32),4..1])) - printTest ((take 7 [(5::Word32),3..1])) - printTest ((take 7 [(5::Word32),3..2])) - printTest ((take 7 [(1::Word32),2..1])) - printTest ((take 7 [(2::Word32),1..2])) - printTest ((take 7 [(2::Word32),1..1])) - printTest ((take 7 [(2::Word32),3..1])) - - let x = (maxBound::Word32) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Word32) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - -testEnumWord64 :: IO () -testEnumWord64 = do - -- succ - printTest ((succ (0::Word64))) - printTest ((succ (minBound::Word64))) - mayBomb (printTest ((succ (maxBound::Word64)))) - - -- pred - printTest (pred (1::Word64)) - printTest (pred (maxBound::Word64)) - mayBomb (printTest (pred (minBound::Word64))) - - -- toEnum - mayBomb (printTest ((map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int]))) - mayBomb (printTest ((toEnum (maxBound::Int))::Word64)) - - -- fromEnum - printTest ((map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)])) - mayBomb (printTest (fromEnum (maxBound::Word64))) - - -- [x..] aka enumFrom - printTest ((take 7 [(1::Word64)..])) - printTest ((take 7 [((maxBound::Word64)-5)..])) -- just in case it doesn't catch the upper bound.. - - -- [x,y..] aka enumFromThen - printTest ((take 7 [(1::Word64),2..])) - printTest ((take 7 [(1::Word64),7..])) - printTest ((take 7 [(1::Word64),1..])) - printTest ((take 7 [(1::Word64),0..])) - printTest ((take 7 [(5::Word64),2..])) - let x = (minBound::Word64) + 1 - printTest ((take 7 [x, x-1 ..])) - let x = (minBound::Word64) + 5 - printTest ((take 7 [x, x-1 ..])) - let x = (maxBound::Word64) - 5 - printTest ((take 7 [x, (x+1) ..])) - - -- [x..y] aka enumFromTo - printTest ((take 7 ([(1::Word64) .. 5]))) - printTest ((take 4 ([(1::Word64) .. 1]))) - printTest ((take 7 ([(1::Word64) .. 0]))) - printTest ((take 7 ([(5::Word64) .. 0]))) - printTest ((take 7 ([(maxBound-(5::Word64)) .. maxBound]))) - printTest ((take 7 ([(minBound+(5::Word64)) .. minBound]))) - - -- [x,y..z] aka enumFromThenTo - printTest ((take 7 [(5::Word64),4..1])) - printTest ((take 7 [(5::Word64),3..1])) - printTest ((take 7 [(5::Word64),3..2])) - printTest ((take 7 [(1::Word64),2..1])) - printTest ((take 7 [(2::Word64),1..2])) - printTest ((take 7 [(2::Word64),1..1])) - printTest ((take 7 [(2::Word64),3..1])) - - let x = (maxBound::Word64) - 4 - printTest ((take 7 [x,(x+1)..maxBound])) - let x = (minBound::Word64) + 5 - printTest ((take 7 [x,(x-1)..minBound])) - - --- --- --- Utils --- --- - - -mayBomb x = catch x (\(ErrorCall e) -> putStrLn ("error " ++ show e)) - `catch` (\e -> putStrLn ("Fail: " ++ show (e :: SomeException))) diff --git a/testsuite/tests/lib/should_run/enum03.stdout b/testsuite/tests/lib/should_run/enum03.stdout deleted file mode 100644 index d6db561a72..0000000000 --- a/testsuite/tests/lib/should_run/enum03.stdout +++ /dev/null @@ -1,142 +0,0 @@ -Testing Enum Word8: - (succ (0::Word8)) = 1 - (succ (minBound::Word8)) = 1 - (succ (maxBound::Word8)) = error "Enum.succ{Word8}: tried to take `succ' of maxBound" - pred (1::Word8) = 0 - pred (maxBound::Word8) = 254 - pred (minBound::Word8) = error "Enum.pred{Word8}: tried to take `pred' of minBound" - (map (toEnum::Int->Word8) [1, fromIntegral (minBound::Word8)::Int, fromIntegral (maxBound::Word8)::Int]) = [1,0,255] - (toEnum (maxBound::Int))::Word8 = error "Enum.toEnum{Word8}: tag (2147483647) is outside of bounds (0,255)" - (map fromEnum [(1::Word8),minBound,maxBound]) = [1,0,255] - (take 7 [(1::Word8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word8)-5)..]) = [250,251,252,253,254,255] - (take 7 [(1::Word8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word8),0..]) = [1,0] - (take 7 [(5::Word8),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [250,251,252,253,254,255] - (take 7 ([(1::Word8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word8) .. 1])) = [1] - (take 7 ([(1::Word8) .. 0])) = [] - (take 7 ([(5::Word8) .. 0])) = [] - (take 7 ([(maxBound-(5::Word8)) .. maxBound])) = [250,251,252,253,254,255] - (take 7 ([(minBound+(5::Word8)) .. minBound])) = [] - (take 7 [(5::Word8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word8),3..1]) = [5,3,1] - (take 7 [(5::Word8),3..2]) = [5,3] - (take 7 [(1::Word8),2..1]) = [1] - (take 7 [(2::Word8),1..2]) = [2] - (take 7 [(2::Word8),1..1]) = [2,1] - (take 7 [(2::Word8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [251,252,253,254,255] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word16: - (succ (0::Word16)) = 1 - (succ (minBound::Word16)) = 1 - (succ (maxBound::Word16)) = error "Enum.succ{Word16}: tried to take `succ' of maxBound" - pred (1::Word16) = 0 - pred (maxBound::Word16) = 65534 - pred (minBound::Word16) = error "Enum.pred{Word16}: tried to take `pred' of minBound" - (map (toEnum::Int->Word16) [1, fromIntegral (minBound::Word16)::Int, fromIntegral (maxBound::Word16)::Int]) = [1,0,65535] - (toEnum (maxBound::Int))::Word16 = error "Enum.toEnum{Word16}: tag (2147483647) is outside of bounds (0,65535)" - (map fromEnum [(1::Word16),minBound,maxBound]) = [1,0,65535] - (take 7 [(1::Word16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word16)-5)..]) = [65530,65531,65532,65533,65534,65535] - (take 7 [(1::Word16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word16),0..]) = [1,0] - (take 7 [(5::Word16),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(1::Word16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word16) .. 1])) = [1] - (take 7 ([(1::Word16) .. 0])) = [] - (take 7 ([(5::Word16) .. 0])) = [] - (take 7 ([(maxBound-(5::Word16)) .. maxBound])) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(minBound+(5::Word16)) .. minBound])) = [] - (take 7 [(5::Word16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word16),3..1]) = [5,3,1] - (take 7 [(5::Word16),3..2]) = [5,3] - (take 7 [(1::Word16),2..1]) = [1] - (take 7 [(2::Word16),1..2]) = [2] - (take 7 [(2::Word16),1..1]) = [2,1] - (take 7 [(2::Word16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [65531,65532,65533,65534,65535] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word32: - (succ (0::Word32)) = 1 - (succ (minBound::Word32)) = 1 - (succ (maxBound::Word32)) = error "Enum.succ{Word32}: tried to take `succ' of maxBound" - pred (1::Word32) = 0 - pred (maxBound::Word32) = 4294967294 - pred (minBound::Word32) = error "Enum.pred{Word32}: tried to take `pred' of minBound" - (map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]) = [1,0,2147483647] - (toEnum (maxBound::Int))::Word32 = 2147483647 - (map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]) = [1,0,2147483647] - fromEnum (maxBound::Word32) = error "Enum.fromEnum{Word32}: value (4294967295) is outside of Int's bounds (-2147483648,2147483647)" - (take 7 [(1::Word32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word32)-5)..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [(1::Word32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word32),0..]) = [1,0] - (take 7 [(5::Word32),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(1::Word32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word32) .. 1])) = [1] - (take 7 ([(1::Word32) .. 0])) = [] - (take 7 ([(5::Word32) .. 0])) = [] - (take 7 ([(maxBound-(5::Word32)) .. maxBound])) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(minBound+(5::Word32)) .. minBound])) = [] - (take 7 [(5::Word32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word32),3..1]) = [5,3,1] - (take 7 [(5::Word32),3..2]) = [5,3] - (take 7 [(1::Word32),2..1]) = [1] - (take 7 [(2::Word32),1..2]) = [2] - (take 7 [(2::Word32),1..1]) = [2,1] - (take 7 [(2::Word32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word64: - (succ (0::Word64)) = 1 - (succ (minBound::Word64)) = 1 - (succ (maxBound::Word64)) = error "Enum.succ{Word64}: tried to take `succ' of maxBound" - pred (1::Word64) = 0 - pred (maxBound::Word64) = 18446744073709551614 - pred (minBound::Word64) = error "Enum.pred{Word64}: tried to take `pred' of minBound" - (map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int]) = [1,0,2147483647] - (toEnum (maxBound::Int))::Word64 = 2147483647 - (map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]) = [1,0,2147483647] - fromEnum (maxBound::Word64) = error "Enum.fromEnum{Word64}: value (18446744073709551615) is outside of Int's bounds (-2147483648,2147483647)" - (take 7 [(1::Word64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word64)-5)..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [(1::Word64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word64),0..]) = [1,0] - (take 7 [(5::Word64),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(1::Word64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word64) .. 1])) = [1] - (take 7 ([(1::Word64) .. 0])) = [] - (take 7 ([(5::Word64) .. 0])) = [] - (take 7 ([(maxBound-(5::Word64)) .. maxBound])) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(minBound+(5::Word64)) .. minBound])) = [] - (take 7 [(5::Word64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word64),3..1]) = [5,3,1] - (take 7 [(5::Word64),3..2]) = [5,3] - (take 7 [(1::Word64),2..1]) = [1] - (take 7 [(2::Word64),1..2]) = [2] - (take 7 [(2::Word64),1..1]) = [2,1] - (take 7 [(2::Word64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] diff --git a/testsuite/tests/lib/should_run/enum03.stdout-alpha-dec-osf3 b/testsuite/tests/lib/should_run/enum03.stdout-alpha-dec-osf3 deleted file mode 100644 index 716782c46a..0000000000 --- a/testsuite/tests/lib/should_run/enum03.stdout-alpha-dec-osf3 +++ /dev/null @@ -1,142 +0,0 @@ -Testing Enum Word8: - (succ (0::Word8)) = 1 - (succ (minBound::Word8)) = 1 - (succ (maxBound::Word8)) = error "Enum.succ{Word8}: tried to take `succ' of maxBound" - pred (1::Word8) = 0 - pred (maxBound::Word8) = 254 - pred (minBound::Word8) = error "Enum.pred{Word8}: tried to take `pred' of minBound" - (map (toEnum::Int->Word8) [1, fromIntegral (minBound::Word8)::Int, fromIntegral (maxBound::Word8)::Int]) = [1,0,255] - (toEnum (maxBound::Int))::Word8 = error "Enum.toEnum{Word8}: tag (9223372036854775807) is outside of bounds (0,255)" - (map fromEnum [(1::Word8),minBound,maxBound]) = [1,0,255] - (take 7 [(1::Word8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word8)-5)..]) = [250,251,252,253,254,255] - (take 7 [(1::Word8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word8),0..]) = [1,0] - (take 7 [(5::Word8),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [250,251,252,253,254,255] - (take 7 ([(1::Word8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word8) .. 1])) = [1] - (take 7 ([(1::Word8) .. 0])) = [] - (take 7 ([(5::Word8) .. 0])) = [] - (take 7 ([(maxBound-(5::Word8)) .. maxBound])) = [250,251,252,253,254,255] - (take 7 ([(minBound+(5::Word8)) .. minBound])) = [] - (take 7 [(5::Word8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word8),3..1]) = [5,3,1] - (take 7 [(5::Word8),3..2]) = [5,3] - (take 7 [(1::Word8),2..1]) = [1] - (take 7 [(2::Word8),1..2]) = [2] - (take 7 [(2::Word8),1..1]) = [2,1] - (take 7 [(2::Word8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [251,252,253,254,255] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word16: - (succ (0::Word16)) = 1 - (succ (minBound::Word16)) = 1 - (succ (maxBound::Word16)) = error "Enum.succ{Word16}: tried to take `succ' of maxBound" - pred (1::Word16) = 0 - pred (maxBound::Word16) = 65534 - pred (minBound::Word16) = error "Enum.pred{Word16}: tried to take `pred' of minBound" - (map (toEnum::Int->Word16) [1, fromIntegral (minBound::Word16)::Int, fromIntegral (maxBound::Word16)::Int]) = [1,0,65535] - (toEnum (maxBound::Int))::Word16 = error "Enum.toEnum{Word16}: tag (9223372036854775807) is outside of bounds (0,65535)" - (map fromEnum [(1::Word16),minBound,maxBound]) = [1,0,65535] - (take 7 [(1::Word16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word16)-5)..]) = [65530,65531,65532,65533,65534,65535] - (take 7 [(1::Word16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word16),0..]) = [1,0] - (take 7 [(5::Word16),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(1::Word16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word16) .. 1])) = [1] - (take 7 ([(1::Word16) .. 0])) = [] - (take 7 ([(5::Word16) .. 0])) = [] - (take 7 ([(maxBound-(5::Word16)) .. maxBound])) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(minBound+(5::Word16)) .. minBound])) = [] - (take 7 [(5::Word16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word16),3..1]) = [5,3,1] - (take 7 [(5::Word16),3..2]) = [5,3] - (take 7 [(1::Word16),2..1]) = [1] - (take 7 [(2::Word16),1..2]) = [2] - (take 7 [(2::Word16),1..1]) = [2,1] - (take 7 [(2::Word16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [65531,65532,65533,65534,65535] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word32: - (succ (0::Word32)) = 1 - (succ (minBound::Word32)) = 1 - (succ (maxBound::Word32)) = error "Enum.succ{Word32}: tried to take `succ' of maxBound" - pred (1::Word32) = 0 - pred (maxBound::Word32) = 4294967294 - pred (minBound::Word32) = error "Enum.pred{Word32}: tried to take `pred' of minBound" - (map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]) = [1,0,2147483647] - (toEnum (maxBound::Int))::Word32 = error "Enum.toEnum{Word32}: tag (9223372036854775807) is outside of bounds (0,4294967295)" - (map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]) = [1,0,4294967295] - fromEnum (maxBound::Word32) = 4294967295 - (take 7 [(1::Word32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word32)-5)..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [(1::Word32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word32),0..]) = [1,0] - (take 7 [(5::Word32),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(1::Word32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word32) .. 1])) = [1] - (take 7 ([(1::Word32) .. 0])) = [] - (take 7 ([(5::Word32) .. 0])) = [] - (take 7 ([(maxBound-(5::Word32)) .. maxBound])) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(minBound+(5::Word32)) .. minBound])) = [] - (take 7 [(5::Word32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word32),3..1]) = [5,3,1] - (take 7 [(5::Word32),3..2]) = [5,3] - (take 7 [(1::Word32),2..1]) = [1] - (take 7 [(2::Word32),1..2]) = [2] - (take 7 [(2::Word32),1..1]) = [2,1] - (take 7 [(2::Word32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word64: - (succ (0::Word64)) = 1 - (succ (minBound::Word64)) = 1 - (succ (maxBound::Word64)) = error "Enum.succ{Word64}: tried to take `succ' of maxBound" - pred (1::Word64) = 0 - pred (maxBound::Word64) = 18446744073709551614 - pred (minBound::Word64) = error "Enum.pred{Word64}: tried to take `pred' of minBound" - (map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int]) = [1,0,9223372036854775807] - (toEnum (maxBound::Int))::Word64 = 9223372036854775807 - (map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]) = [1,0,9223372036854775807] - fromEnum (maxBound::Word64) = error "Enum.fromEnum{Word64}: value (18446744073709551615) is outside of Int's bounds (-9223372036854775808,9223372036854775807)" - (take 7 [(1::Word64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word64)-5)..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [(1::Word64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word64),0..]) = [1,0] - (take 7 [(5::Word64),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(1::Word64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word64) .. 1])) = [1] - (take 7 ([(1::Word64) .. 0])) = [] - (take 7 ([(5::Word64) .. 0])) = [] - (take 7 ([(maxBound-(5::Word64)) .. maxBound])) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(minBound+(5::Word64)) .. minBound])) = [] - (take 7 [(5::Word64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word64),3..1]) = [5,3,1] - (take 7 [(5::Word64),3..2]) = [5,3] - (take 7 [(1::Word64),2..1]) = [1] - (take 7 [(2::Word64),1..2]) = [2] - (take 7 [(2::Word64),1..1]) = [2,1] - (take 7 [(2::Word64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] diff --git a/testsuite/tests/lib/should_run/enum03.stdout-hugs b/testsuite/tests/lib/should_run/enum03.stdout-hugs deleted file mode 100644 index babc1c2e9e..0000000000 --- a/testsuite/tests/lib/should_run/enum03.stdout-hugs +++ /dev/null @@ -1,142 +0,0 @@ -Testing Enum Word8: - (succ (0::Word8)) = 1 - (succ (minBound::Word8)) = 1 - (succ (maxBound::Word8)) = error "succ: applied to maxBound" - pred (1::Word8) = 0 - pred (maxBound::Word8) = 254 - pred (minBound::Word8) = error "pred: applied to minBound" - (map (toEnum::Int->Word8) [1, fromIntegral (minBound::Word8)::Int, fromIntegral (maxBound::Word8)::Int]) = [1,0,255] - (toEnum (maxBound::Int))::Word8 = 255 - (map fromEnum [(1::Word8),minBound,maxBound]) = [1,0,255] - (take 7 [(1::Word8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word8)-5)..]) = [250,251,252,253,254,255] - (take 7 [(1::Word8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word8),0..]) = [1,0] - (take 7 [(5::Word8),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [250,251,252,253,254,255] - (take 7 ([(1::Word8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word8) .. 1])) = [1] - (take 7 ([(1::Word8) .. 0])) = [] - (take 7 ([(5::Word8) .. 0])) = [] - (take 7 ([(maxBound-(5::Word8)) .. maxBound])) = [250,251,252,253,254,255] - (take 7 ([(minBound+(5::Word8)) .. minBound])) = [] - (take 7 [(5::Word8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word8),3..1]) = [5,3,1] - (take 7 [(5::Word8),3..2]) = [5,3] - (take 7 [(1::Word8),2..1]) = [1] - (take 7 [(2::Word8),1..2]) = [2] - (take 7 [(2::Word8),1..1]) = [2,1] - (take 7 [(2::Word8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [251,252,253,254,255] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word16: - (succ (0::Word16)) = 1 - (succ (minBound::Word16)) = 1 - (succ (maxBound::Word16)) = error "succ: applied to maxBound" - pred (1::Word16) = 0 - pred (maxBound::Word16) = 65534 - pred (minBound::Word16) = error "pred: applied to minBound" - (map (toEnum::Int->Word16) [1, fromIntegral (minBound::Word16)::Int, fromIntegral (maxBound::Word16)::Int]) = [1,0,65535] - (toEnum (maxBound::Int))::Word16 = 65535 - (map fromEnum [(1::Word16),minBound,maxBound]) = [1,0,65535] - (take 7 [(1::Word16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word16)-5)..]) = [65530,65531,65532,65533,65534,65535] - (take 7 [(1::Word16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word16),0..]) = [1,0] - (take 7 [(5::Word16),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(1::Word16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word16) .. 1])) = [1] - (take 7 ([(1::Word16) .. 0])) = [] - (take 7 ([(5::Word16) .. 0])) = [] - (take 7 ([(maxBound-(5::Word16)) .. maxBound])) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(minBound+(5::Word16)) .. minBound])) = [] - (take 7 [(5::Word16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word16),3..1]) = [5,3,1] - (take 7 [(5::Word16),3..2]) = [5,3] - (take 7 [(1::Word16),2..1]) = [1] - (take 7 [(2::Word16),1..2]) = [2] - (take 7 [(2::Word16),1..1]) = [2,1] - (take 7 [(2::Word16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [65531,65532,65533,65534,65535] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word32: - (succ (0::Word32)) = 1 - (succ (minBound::Word32)) = 1 - (succ (maxBound::Word32)) = error "succ: applied to maxBound" - pred (1::Word32) = 0 - pred (maxBound::Word32) = 4294967294 - pred (minBound::Word32) = error "pred: applied to minBound" - (map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]) = [1,0,2147483647] - (toEnum (maxBound::Int))::Word32 = 2147483647 - (map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]) = [1,0,2147483647] - fromEnum (maxBound::Word32) = -1 - (take 7 [(1::Word32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word32)-5)..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [(1::Word32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word32),0..]) = [1,0] - (take 7 [(5::Word32),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(1::Word32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word32) .. 1])) = [1] - (take 7 ([(1::Word32) .. 0])) = [] - (take 7 ([(5::Word32) .. 0])) = [] - (take 7 ([(maxBound-(5::Word32)) .. maxBound])) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(minBound+(5::Word32)) .. minBound])) = [] - (take 7 [(5::Word32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word32),3..1]) = [5,3,1] - (take 7 [(5::Word32),3..2]) = [5,3] - (take 7 [(1::Word32),2..1]) = [1] - (take 7 [(2::Word32),1..2]) = [2] - (take 7 [(2::Word32),1..1]) = [2,1] - (take 7 [(2::Word32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word64: - (succ (0::Word64)) = 1 - (succ (minBound::Word64)) = 1 - (succ (maxBound::Word64)) = error "succ: applied to maxBound" - pred (1::Word64) = 0 - pred (maxBound::Word64) = 18446744073709551614 - pred (minBound::Word64) = error "pred: applied to minBound" - (map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int]) = [1,0,2147483647] - (toEnum (maxBound::Int))::Word64 = 2147483647 - (map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]) = [1,0,2147483647] - fromEnum (maxBound::Word64) = Fail: arithmetic overflow - (take 7 [(1::Word64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word64)-5)..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [(1::Word64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word64),0..]) = [1,0] - (take 7 [(5::Word64),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(1::Word64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word64) .. 1])) = [1] - (take 7 ([(1::Word64) .. 0])) = [] - (take 7 ([(5::Word64) .. 0])) = [] - (take 7 ([(maxBound-(5::Word64)) .. maxBound])) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(minBound+(5::Word64)) .. minBound])) = [] - (take 7 [(5::Word64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word64),3..1]) = [5,3,1] - (take 7 [(5::Word64),3..2]) = [5,3] - (take 7 [(1::Word64),2..1]) = [1] - (take 7 [(2::Word64),1..2]) = [2] - (take 7 [(2::Word64),1..1]) = [2,1] - (take 7 [(2::Word64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] diff --git a/testsuite/tests/lib/should_run/enum03.stdout-mips-sgi-irix b/testsuite/tests/lib/should_run/enum03.stdout-mips-sgi-irix deleted file mode 100644 index 716782c46a..0000000000 --- a/testsuite/tests/lib/should_run/enum03.stdout-mips-sgi-irix +++ /dev/null @@ -1,142 +0,0 @@ -Testing Enum Word8: - (succ (0::Word8)) = 1 - (succ (minBound::Word8)) = 1 - (succ (maxBound::Word8)) = error "Enum.succ{Word8}: tried to take `succ' of maxBound" - pred (1::Word8) = 0 - pred (maxBound::Word8) = 254 - pred (minBound::Word8) = error "Enum.pred{Word8}: tried to take `pred' of minBound" - (map (toEnum::Int->Word8) [1, fromIntegral (minBound::Word8)::Int, fromIntegral (maxBound::Word8)::Int]) = [1,0,255] - (toEnum (maxBound::Int))::Word8 = error "Enum.toEnum{Word8}: tag (9223372036854775807) is outside of bounds (0,255)" - (map fromEnum [(1::Word8),minBound,maxBound]) = [1,0,255] - (take 7 [(1::Word8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word8)-5)..]) = [250,251,252,253,254,255] - (take 7 [(1::Word8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word8),0..]) = [1,0] - (take 7 [(5::Word8),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [250,251,252,253,254,255] - (take 7 ([(1::Word8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word8) .. 1])) = [1] - (take 7 ([(1::Word8) .. 0])) = [] - (take 7 ([(5::Word8) .. 0])) = [] - (take 7 ([(maxBound-(5::Word8)) .. maxBound])) = [250,251,252,253,254,255] - (take 7 ([(minBound+(5::Word8)) .. minBound])) = [] - (take 7 [(5::Word8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word8),3..1]) = [5,3,1] - (take 7 [(5::Word8),3..2]) = [5,3] - (take 7 [(1::Word8),2..1]) = [1] - (take 7 [(2::Word8),1..2]) = [2] - (take 7 [(2::Word8),1..1]) = [2,1] - (take 7 [(2::Word8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [251,252,253,254,255] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word16: - (succ (0::Word16)) = 1 - (succ (minBound::Word16)) = 1 - (succ (maxBound::Word16)) = error "Enum.succ{Word16}: tried to take `succ' of maxBound" - pred (1::Word16) = 0 - pred (maxBound::Word16) = 65534 - pred (minBound::Word16) = error "Enum.pred{Word16}: tried to take `pred' of minBound" - (map (toEnum::Int->Word16) [1, fromIntegral (minBound::Word16)::Int, fromIntegral (maxBound::Word16)::Int]) = [1,0,65535] - (toEnum (maxBound::Int))::Word16 = error "Enum.toEnum{Word16}: tag (9223372036854775807) is outside of bounds (0,65535)" - (map fromEnum [(1::Word16),minBound,maxBound]) = [1,0,65535] - (take 7 [(1::Word16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word16)-5)..]) = [65530,65531,65532,65533,65534,65535] - (take 7 [(1::Word16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word16),0..]) = [1,0] - (take 7 [(5::Word16),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(1::Word16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word16) .. 1])) = [1] - (take 7 ([(1::Word16) .. 0])) = [] - (take 7 ([(5::Word16) .. 0])) = [] - (take 7 ([(maxBound-(5::Word16)) .. maxBound])) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(minBound+(5::Word16)) .. minBound])) = [] - (take 7 [(5::Word16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word16),3..1]) = [5,3,1] - (take 7 [(5::Word16),3..2]) = [5,3] - (take 7 [(1::Word16),2..1]) = [1] - (take 7 [(2::Word16),1..2]) = [2] - (take 7 [(2::Word16),1..1]) = [2,1] - (take 7 [(2::Word16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [65531,65532,65533,65534,65535] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word32: - (succ (0::Word32)) = 1 - (succ (minBound::Word32)) = 1 - (succ (maxBound::Word32)) = error "Enum.succ{Word32}: tried to take `succ' of maxBound" - pred (1::Word32) = 0 - pred (maxBound::Word32) = 4294967294 - pred (minBound::Word32) = error "Enum.pred{Word32}: tried to take `pred' of minBound" - (map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]) = [1,0,2147483647] - (toEnum (maxBound::Int))::Word32 = error "Enum.toEnum{Word32}: tag (9223372036854775807) is outside of bounds (0,4294967295)" - (map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]) = [1,0,4294967295] - fromEnum (maxBound::Word32) = 4294967295 - (take 7 [(1::Word32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word32)-5)..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [(1::Word32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word32),0..]) = [1,0] - (take 7 [(5::Word32),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(1::Word32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word32) .. 1])) = [1] - (take 7 ([(1::Word32) .. 0])) = [] - (take 7 ([(5::Word32) .. 0])) = [] - (take 7 ([(maxBound-(5::Word32)) .. maxBound])) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(minBound+(5::Word32)) .. minBound])) = [] - (take 7 [(5::Word32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word32),3..1]) = [5,3,1] - (take 7 [(5::Word32),3..2]) = [5,3] - (take 7 [(1::Word32),2..1]) = [1] - (take 7 [(2::Word32),1..2]) = [2] - (take 7 [(2::Word32),1..1]) = [2,1] - (take 7 [(2::Word32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word64: - (succ (0::Word64)) = 1 - (succ (minBound::Word64)) = 1 - (succ (maxBound::Word64)) = error "Enum.succ{Word64}: tried to take `succ' of maxBound" - pred (1::Word64) = 0 - pred (maxBound::Word64) = 18446744073709551614 - pred (minBound::Word64) = error "Enum.pred{Word64}: tried to take `pred' of minBound" - (map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int]) = [1,0,9223372036854775807] - (toEnum (maxBound::Int))::Word64 = 9223372036854775807 - (map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]) = [1,0,9223372036854775807] - fromEnum (maxBound::Word64) = error "Enum.fromEnum{Word64}: value (18446744073709551615) is outside of Int's bounds (-9223372036854775808,9223372036854775807)" - (take 7 [(1::Word64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word64)-5)..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [(1::Word64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word64),0..]) = [1,0] - (take 7 [(5::Word64),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(1::Word64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word64) .. 1])) = [1] - (take 7 ([(1::Word64) .. 0])) = [] - (take 7 ([(5::Word64) .. 0])) = [] - (take 7 ([(maxBound-(5::Word64)) .. maxBound])) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(minBound+(5::Word64)) .. minBound])) = [] - (take 7 [(5::Word64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word64),3..1]) = [5,3,1] - (take 7 [(5::Word64),3..2]) = [5,3] - (take 7 [(1::Word64),2..1]) = [1] - (take 7 [(2::Word64),1..2]) = [2] - (take 7 [(2::Word64),1..1]) = [2,1] - (take 7 [(2::Word64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] diff --git a/testsuite/tests/lib/should_run/enum03.stdout-ws-64 b/testsuite/tests/lib/should_run/enum03.stdout-ws-64 deleted file mode 100644 index 716782c46a..0000000000 --- a/testsuite/tests/lib/should_run/enum03.stdout-ws-64 +++ /dev/null @@ -1,142 +0,0 @@ -Testing Enum Word8: - (succ (0::Word8)) = 1 - (succ (minBound::Word8)) = 1 - (succ (maxBound::Word8)) = error "Enum.succ{Word8}: tried to take `succ' of maxBound" - pred (1::Word8) = 0 - pred (maxBound::Word8) = 254 - pred (minBound::Word8) = error "Enum.pred{Word8}: tried to take `pred' of minBound" - (map (toEnum::Int->Word8) [1, fromIntegral (minBound::Word8)::Int, fromIntegral (maxBound::Word8)::Int]) = [1,0,255] - (toEnum (maxBound::Int))::Word8 = error "Enum.toEnum{Word8}: tag (9223372036854775807) is outside of bounds (0,255)" - (map fromEnum [(1::Word8),minBound,maxBound]) = [1,0,255] - (take 7 [(1::Word8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word8)-5)..]) = [250,251,252,253,254,255] - (take 7 [(1::Word8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word8),0..]) = [1,0] - (take 7 [(5::Word8),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [250,251,252,253,254,255] - (take 7 ([(1::Word8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word8) .. 1])) = [1] - (take 7 ([(1::Word8) .. 0])) = [] - (take 7 ([(5::Word8) .. 0])) = [] - (take 7 ([(maxBound-(5::Word8)) .. maxBound])) = [250,251,252,253,254,255] - (take 7 ([(minBound+(5::Word8)) .. minBound])) = [] - (take 7 [(5::Word8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word8),3..1]) = [5,3,1] - (take 7 [(5::Word8),3..2]) = [5,3] - (take 7 [(1::Word8),2..1]) = [1] - (take 7 [(2::Word8),1..2]) = [2] - (take 7 [(2::Word8),1..1]) = [2,1] - (take 7 [(2::Word8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [251,252,253,254,255] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word16: - (succ (0::Word16)) = 1 - (succ (minBound::Word16)) = 1 - (succ (maxBound::Word16)) = error "Enum.succ{Word16}: tried to take `succ' of maxBound" - pred (1::Word16) = 0 - pred (maxBound::Word16) = 65534 - pred (minBound::Word16) = error "Enum.pred{Word16}: tried to take `pred' of minBound" - (map (toEnum::Int->Word16) [1, fromIntegral (minBound::Word16)::Int, fromIntegral (maxBound::Word16)::Int]) = [1,0,65535] - (toEnum (maxBound::Int))::Word16 = error "Enum.toEnum{Word16}: tag (9223372036854775807) is outside of bounds (0,65535)" - (map fromEnum [(1::Word16),minBound,maxBound]) = [1,0,65535] - (take 7 [(1::Word16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word16)-5)..]) = [65530,65531,65532,65533,65534,65535] - (take 7 [(1::Word16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word16),0..]) = [1,0] - (take 7 [(5::Word16),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(1::Word16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word16) .. 1])) = [1] - (take 7 ([(1::Word16) .. 0])) = [] - (take 7 ([(5::Word16) .. 0])) = [] - (take 7 ([(maxBound-(5::Word16)) .. maxBound])) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(minBound+(5::Word16)) .. minBound])) = [] - (take 7 [(5::Word16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word16),3..1]) = [5,3,1] - (take 7 [(5::Word16),3..2]) = [5,3] - (take 7 [(1::Word16),2..1]) = [1] - (take 7 [(2::Word16),1..2]) = [2] - (take 7 [(2::Word16),1..1]) = [2,1] - (take 7 [(2::Word16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [65531,65532,65533,65534,65535] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word32: - (succ (0::Word32)) = 1 - (succ (minBound::Word32)) = 1 - (succ (maxBound::Word32)) = error "Enum.succ{Word32}: tried to take `succ' of maxBound" - pred (1::Word32) = 0 - pred (maxBound::Word32) = 4294967294 - pred (minBound::Word32) = error "Enum.pred{Word32}: tried to take `pred' of minBound" - (map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]) = [1,0,2147483647] - (toEnum (maxBound::Int))::Word32 = error "Enum.toEnum{Word32}: tag (9223372036854775807) is outside of bounds (0,4294967295)" - (map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]) = [1,0,4294967295] - fromEnum (maxBound::Word32) = 4294967295 - (take 7 [(1::Word32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word32)-5)..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [(1::Word32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word32),0..]) = [1,0] - (take 7 [(5::Word32),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(1::Word32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word32) .. 1])) = [1] - (take 7 ([(1::Word32) .. 0])) = [] - (take 7 ([(5::Word32) .. 0])) = [] - (take 7 ([(maxBound-(5::Word32)) .. maxBound])) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(minBound+(5::Word32)) .. minBound])) = [] - (take 7 [(5::Word32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word32),3..1]) = [5,3,1] - (take 7 [(5::Word32),3..2]) = [5,3] - (take 7 [(1::Word32),2..1]) = [1] - (take 7 [(2::Word32),1..2]) = [2] - (take 7 [(2::Word32),1..1]) = [2,1] - (take 7 [(2::Word32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word64: - (succ (0::Word64)) = 1 - (succ (minBound::Word64)) = 1 - (succ (maxBound::Word64)) = error "Enum.succ{Word64}: tried to take `succ' of maxBound" - pred (1::Word64) = 0 - pred (maxBound::Word64) = 18446744073709551614 - pred (minBound::Word64) = error "Enum.pred{Word64}: tried to take `pred' of minBound" - (map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int]) = [1,0,9223372036854775807] - (toEnum (maxBound::Int))::Word64 = 9223372036854775807 - (map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]) = [1,0,9223372036854775807] - fromEnum (maxBound::Word64) = error "Enum.fromEnum{Word64}: value (18446744073709551615) is outside of Int's bounds (-9223372036854775808,9223372036854775807)" - (take 7 [(1::Word64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word64)-5)..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [(1::Word64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word64),0..]) = [1,0] - (take 7 [(5::Word64),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(1::Word64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word64) .. 1])) = [1] - (take 7 ([(1::Word64) .. 0])) = [] - (take 7 ([(5::Word64) .. 0])) = [] - (take 7 ([(maxBound-(5::Word64)) .. maxBound])) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(minBound+(5::Word64)) .. minBound])) = [] - (take 7 [(5::Word64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word64),3..1]) = [5,3,1] - (take 7 [(5::Word64),3..2]) = [5,3] - (take 7 [(1::Word64),2..1]) = [1] - (take 7 [(2::Word64),1..2]) = [2] - (take 7 [(2::Word64),1..1]) = [2,1] - (take 7 [(2::Word64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] diff --git a/testsuite/tests/lib/should_run/enum03.stdout-x86_64-unknown-openbsd b/testsuite/tests/lib/should_run/enum03.stdout-x86_64-unknown-openbsd deleted file mode 100644 index 716782c46a..0000000000 --- a/testsuite/tests/lib/should_run/enum03.stdout-x86_64-unknown-openbsd +++ /dev/null @@ -1,142 +0,0 @@ -Testing Enum Word8: - (succ (0::Word8)) = 1 - (succ (minBound::Word8)) = 1 - (succ (maxBound::Word8)) = error "Enum.succ{Word8}: tried to take `succ' of maxBound" - pred (1::Word8) = 0 - pred (maxBound::Word8) = 254 - pred (minBound::Word8) = error "Enum.pred{Word8}: tried to take `pred' of minBound" - (map (toEnum::Int->Word8) [1, fromIntegral (minBound::Word8)::Int, fromIntegral (maxBound::Word8)::Int]) = [1,0,255] - (toEnum (maxBound::Int))::Word8 = error "Enum.toEnum{Word8}: tag (9223372036854775807) is outside of bounds (0,255)" - (map fromEnum [(1::Word8),minBound,maxBound]) = [1,0,255] - (take 7 [(1::Word8)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word8)-5)..]) = [250,251,252,253,254,255] - (take 7 [(1::Word8),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word8),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word8),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word8),0..]) = [1,0] - (take 7 [(5::Word8),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [250,251,252,253,254,255] - (take 7 ([(1::Word8) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word8) .. 1])) = [1] - (take 7 ([(1::Word8) .. 0])) = [] - (take 7 ([(5::Word8) .. 0])) = [] - (take 7 ([(maxBound-(5::Word8)) .. maxBound])) = [250,251,252,253,254,255] - (take 7 ([(minBound+(5::Word8)) .. minBound])) = [] - (take 7 [(5::Word8),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word8),3..1]) = [5,3,1] - (take 7 [(5::Word8),3..2]) = [5,3] - (take 7 [(1::Word8),2..1]) = [1] - (take 7 [(2::Word8),1..2]) = [2] - (take 7 [(2::Word8),1..1]) = [2,1] - (take 7 [(2::Word8),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [251,252,253,254,255] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word16: - (succ (0::Word16)) = 1 - (succ (minBound::Word16)) = 1 - (succ (maxBound::Word16)) = error "Enum.succ{Word16}: tried to take `succ' of maxBound" - pred (1::Word16) = 0 - pred (maxBound::Word16) = 65534 - pred (minBound::Word16) = error "Enum.pred{Word16}: tried to take `pred' of minBound" - (map (toEnum::Int->Word16) [1, fromIntegral (minBound::Word16)::Int, fromIntegral (maxBound::Word16)::Int]) = [1,0,65535] - (toEnum (maxBound::Int))::Word16 = error "Enum.toEnum{Word16}: tag (9223372036854775807) is outside of bounds (0,65535)" - (map fromEnum [(1::Word16),minBound,maxBound]) = [1,0,65535] - (take 7 [(1::Word16)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word16)-5)..]) = [65530,65531,65532,65533,65534,65535] - (take 7 [(1::Word16),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word16),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word16),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word16),0..]) = [1,0] - (take 7 [(5::Word16),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(1::Word16) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word16) .. 1])) = [1] - (take 7 ([(1::Word16) .. 0])) = [] - (take 7 ([(5::Word16) .. 0])) = [] - (take 7 ([(maxBound-(5::Word16)) .. maxBound])) = [65530,65531,65532,65533,65534,65535] - (take 7 ([(minBound+(5::Word16)) .. minBound])) = [] - (take 7 [(5::Word16),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word16),3..1]) = [5,3,1] - (take 7 [(5::Word16),3..2]) = [5,3] - (take 7 [(1::Word16),2..1]) = [1] - (take 7 [(2::Word16),1..2]) = [2] - (take 7 [(2::Word16),1..1]) = [2,1] - (take 7 [(2::Word16),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [65531,65532,65533,65534,65535] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word32: - (succ (0::Word32)) = 1 - (succ (minBound::Word32)) = 1 - (succ (maxBound::Word32)) = error "Enum.succ{Word32}: tried to take `succ' of maxBound" - pred (1::Word32) = 0 - pred (maxBound::Word32) = 4294967294 - pred (minBound::Word32) = error "Enum.pred{Word32}: tried to take `pred' of minBound" - (map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]) = [1,0,2147483647] - (toEnum (maxBound::Int))::Word32 = error "Enum.toEnum{Word32}: tag (9223372036854775807) is outside of bounds (0,4294967295)" - (map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]) = [1,0,4294967295] - fromEnum (maxBound::Word32) = 4294967295 - (take 7 [(1::Word32)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word32)-5)..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [(1::Word32),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word32),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word32),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word32),0..]) = [1,0] - (take 7 [(5::Word32),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(1::Word32) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word32) .. 1])) = [1] - (take 7 ([(1::Word32) .. 0])) = [] - (take 7 ([(5::Word32) .. 0])) = [] - (take 7 ([(maxBound-(5::Word32)) .. maxBound])) = [4294967290,4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 ([(minBound+(5::Word32)) .. minBound])) = [] - (take 7 [(5::Word32),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word32),3..1]) = [5,3,1] - (take 7 [(5::Word32),3..2]) = [5,3] - (take 7 [(1::Word32),2..1]) = [1] - (take 7 [(2::Word32),1..2]) = [2] - (take 7 [(2::Word32),1..1]) = [2,1] - (take 7 [(2::Word32),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [4294967291,4294967292,4294967293,4294967294,4294967295] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] -Testing Enum Word64: - (succ (0::Word64)) = 1 - (succ (minBound::Word64)) = 1 - (succ (maxBound::Word64)) = error "Enum.succ{Word64}: tried to take `succ' of maxBound" - pred (1::Word64) = 0 - pred (maxBound::Word64) = 18446744073709551614 - pred (minBound::Word64) = error "Enum.pred{Word64}: tried to take `pred' of minBound" - (map (toEnum::Int->Word64) [1, fromIntegral (minBound::Word64)::Int, maxBound::Int]) = [1,0,9223372036854775807] - (toEnum (maxBound::Int))::Word64 = 9223372036854775807 - (map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)]) = [1,0,9223372036854775807] - fromEnum (maxBound::Word64) = error "Enum.fromEnum{Word64}: value (18446744073709551615) is outside of Int's bounds (-9223372036854775808,9223372036854775807)" - (take 7 [(1::Word64)..]) = [1,2,3,4,5,6,7] - (take 7 [((maxBound::Word64)-5)..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [(1::Word64),2..]) = [1,2,3,4,5,6,7] - (take 7 [(1::Word64),7..]) = [1,7,13,19,25,31,37] - (take 7 [(1::Word64),1..]) = [1,1,1,1,1,1,1] - (take 7 [(1::Word64),0..]) = [1,0] - (take 7 [(5::Word64),2..]) = [5,2] - (take 7 [x, x-1 ..]) = [1,0] - (take 7 [x, x-1 ..]) = [5,4,3,2,1,0] - (take 7 [x, (x+1) ..]) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(1::Word64) .. 5])) = [1,2,3,4,5] - (take 4 ([(1::Word64) .. 1])) = [1] - (take 7 ([(1::Word64) .. 0])) = [] - (take 7 ([(5::Word64) .. 0])) = [] - (take 7 ([(maxBound-(5::Word64)) .. maxBound])) = [18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 ([(minBound+(5::Word64)) .. minBound])) = [] - (take 7 [(5::Word64),4..1]) = [5,4,3,2,1] - (take 7 [(5::Word64),3..1]) = [5,3,1] - (take 7 [(5::Word64),3..2]) = [5,3] - (take 7 [(1::Word64),2..1]) = [1] - (take 7 [(2::Word64),1..2]) = [2] - (take 7 [(2::Word64),1..1]) = [2,1] - (take 7 [(2::Word64),3..1]) = [] - (take 7 [x,(x+1)..maxBound]) = [18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615] - (take 7 [x,(x-1)..minBound]) = [5,4,3,2,1,0] diff --git a/testsuite/tests/lib/should_run/enum04.hs b/testsuite/tests/lib/should_run/enum04.hs deleted file mode 100644 index fed9e8c4ef..0000000000 --- a/testsuite/tests/lib/should_run/enum04.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE ScopedTypeVariables #-} -import Control.Exception -import Prelude hiding (catch) - --- enumFrom on basic numeric types should be strict --- (possibly a bug in the Haskell Report: it specifies that --- these ops should be strict in the section on Enum, but the --- 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") diff --git a/testsuite/tests/lib/should_run/enum04.stdout b/testsuite/tests/lib/should_run/enum04.stdout deleted file mode 100644 index c8a3e21e6d..0000000000 --- a/testsuite/tests/lib/should_run/enum04.stdout +++ /dev/null @@ -1,4 +0,0 @@ -ok1 -ok2 -ok3 -ok4 diff --git a/testsuite/tests/lib/should_run/exceptionsrun001.hs b/testsuite/tests/lib/should_run/exceptionsrun001.hs deleted file mode 100644 index c858ba5574..0000000000 --- a/testsuite/tests/lib/should_run/exceptionsrun001.hs +++ /dev/null @@ -1,47 +0,0 @@ -module Main where - -import Prelude hiding (catch) -import Control.Exception -import System.IO.Error hiding (catch, try) - -main = do - ioTest - errorTest - noMethodTest - patMatchTest - guardTest - -ioTest :: IO () -ioTest = catchJust (\e -> if isUserError e then Just () else Nothing) - (ioError (userError "wibble")) - (\() -> putStrLn "user exception caught") - -errorTest :: IO () -errorTest = do r <- try (evaluate (1 + error "call to 'error'")) - case r of - Left (ErrorCall _) -> putStrLn "error call caught" - Right _ -> error "help!" - -instance (Show a, Eq a) => Num (Maybe a) where {} - -noMethodTest :: IO () -noMethodTest = do r <- try (evaluate (Just () + Just ())) - case r of - Left (NoMethodError err) -> putStrLn "no method error" - Right _ -> error "help!" - -patMatchTest :: IO () -patMatchTest = catch (case test1 [1..10] of () -> return ()) - (\ex -> case ex of - PatternMatchFail err -> putStr err - _ -> error "help!") - -test1 [] = () - -guardTest = catch (case test2 of () -> return ()) - (\ex -> case ex of - PatternMatchFail err -> putStr err - _ -> error "help!") - -test2 | all (==0) [1] = () - diff --git a/testsuite/tests/lib/should_run/exceptionsrun001.stdout b/testsuite/tests/lib/should_run/exceptionsrun001.stdout deleted file mode 100644 index a84f33ace9..0000000000 --- a/testsuite/tests/lib/should_run/exceptionsrun001.stdout +++ /dev/null @@ -1,5 +0,0 @@ -user exception caught -error call caught -no method error -exceptionsrun001.hs:39:1-13: Non-exhaustive patterns in function test1 -exceptionsrun001.hs:46:1-26: Non-exhaustive patterns in function test2 diff --git a/testsuite/tests/lib/should_run/exceptionsrun002.hs b/testsuite/tests/lib/should_run/exceptionsrun002.hs deleted file mode 100644 index 9503001a31..0000000000 --- a/testsuite/tests/lib/should_run/exceptionsrun002.hs +++ /dev/null @@ -1,96 +0,0 @@ -module Main where - -import qualified Control.Exception as Exception -import System.IO.Error (mkIOError) -import Data.IORef -import Prelude - -safeCatch :: IO () -> IO () -safeCatch f = Exception.catch f - ((\_ -> return ()) :: Exception.SomeException -> IO ()) - -type Thrower = IO Bool - -type Catcher = IO Bool -> IO () -> IO () - -checkCatch :: Catcher -> Thrower -> IO Bool -checkCatch catcher thrower = do - ref <- newIORef False - safeCatch (catcher thrower (writeIORef ref True)) - readIORef ref - -data Named a = MkNamed String a - -checkNamedCatch :: Named Catcher -> Named Thrower -> IO () -checkNamedCatch (MkNamed cname catcher) (MkNamed tname thrower) = do - didCatch <- checkCatch catcher thrower - putStrLn (cname ++ (if didCatch then " CAUGHT " else " MISSED ") ++ tname) - -checkNamedCatches :: [Named Catcher] -> [Named Thrower] -> IO () -checkNamedCatches [] _ = return () -checkNamedCatches _ [] = return () -checkNamedCatches [c] (t:tr) = do checkNamedCatch c t - checkNamedCatches [c] tr -checkNamedCatches (c:cr) ts = do checkNamedCatches [c] ts - checkNamedCatches cr ts - - --- throwers - -returnThrower :: Named Thrower -returnThrower = MkNamed "return" (return True) - -returnUndefinedThrower :: Named Thrower -returnUndefinedThrower = MkNamed "return undefined" (return undefined) - -returnErrorThrower :: Named Thrower -returnErrorThrower = MkNamed "return error" (return (error "some error")) - -undefinedThrower :: Named Thrower -undefinedThrower = MkNamed "undefined" undefined - -failThrower :: Named Thrower -failThrower = MkNamed "fail" (fail "some failure") - -errorThrower :: Named Thrower -errorThrower = MkNamed "error" (error "some error") - -throwThrower :: Named Thrower -throwThrower = MkNamed "Exception.throw" - (Exception.throw (Exception.ErrorCall "throw error")) - -ioErrorErrorCallThrower :: Named Thrower -ioErrorErrorCallThrower = MkNamed "ioError ErrorCall" - (Exception.throwIO (Exception.ErrorCall "throw error")) - -ioErrorIOExceptionThrower :: Named Thrower -ioErrorIOExceptionThrower = MkNamed "ioError IOException" - (Exception.throwIO (mkIOError undefined undefined undefined undefined)) - -returnThrowThrower :: Named Thrower -returnThrowThrower = MkNamed "return Exception.throw" - (return (Exception.throw (Exception.ErrorCall "throw error"))) - - --- catchers - -bindCatcher :: Named Catcher -bindCatcher = MkNamed ">>" (>>) - -preludeCatchCatcher :: Named Catcher -preludeCatchCatcher = MkNamed "Prelude.catch" - (\f cc -> Prelude.catch (f >> (return ())) (const cc)) - -ceCatchCatcher :: Named Catcher -ceCatchCatcher = MkNamed "Exception.catch" - (\f cc -> Exception.catch (f >> (return ())) (const cc :: Exception.SomeException -> IO ())) - -finallyCatcher :: Named Catcher -finallyCatcher = MkNamed "Exception.finally" - (\f cc -> Exception.finally (f >> (return ())) cc) - -main = checkNamedCatches - [bindCatcher,preludeCatchCatcher,ceCatchCatcher,finallyCatcher] - [returnThrower,returnUndefinedThrower,returnThrowThrower,returnErrorThrower,failThrower, - errorThrower,throwThrower,ioErrorErrorCallThrower,ioErrorIOExceptionThrower,undefinedThrower] - diff --git a/testsuite/tests/lib/should_run/exceptionsrun002.stdout b/testsuite/tests/lib/should_run/exceptionsrun002.stdout deleted file mode 100644 index e15116f5c0..0000000000 --- a/testsuite/tests/lib/should_run/exceptionsrun002.stdout +++ /dev/null @@ -1,40 +0,0 @@ ->> CAUGHT return ->> CAUGHT return undefined ->> CAUGHT return Exception.throw ->> CAUGHT return error ->> MISSED fail ->> MISSED error ->> MISSED Exception.throw ->> MISSED ioError ErrorCall ->> MISSED ioError IOException ->> MISSED undefined -Prelude.catch MISSED return -Prelude.catch MISSED return undefined -Prelude.catch MISSED return Exception.throw -Prelude.catch MISSED return error -Prelude.catch CAUGHT fail -Prelude.catch MISSED error -Prelude.catch MISSED Exception.throw -Prelude.catch MISSED ioError ErrorCall -Prelude.catch CAUGHT ioError IOException -Prelude.catch MISSED undefined -Exception.catch MISSED return -Exception.catch MISSED return undefined -Exception.catch MISSED return Exception.throw -Exception.catch MISSED return error -Exception.catch CAUGHT fail -Exception.catch CAUGHT error -Exception.catch CAUGHT Exception.throw -Exception.catch CAUGHT ioError ErrorCall -Exception.catch CAUGHT ioError IOException -Exception.catch CAUGHT undefined -Exception.finally CAUGHT return -Exception.finally CAUGHT return undefined -Exception.finally CAUGHT return Exception.throw -Exception.finally CAUGHT return error -Exception.finally CAUGHT fail -Exception.finally CAUGHT error -Exception.finally CAUGHT Exception.throw -Exception.finally CAUGHT ioError ErrorCall -Exception.finally CAUGHT ioError IOException -Exception.finally CAUGHT undefined diff --git a/testsuite/tests/lib/should_run/length001.hs b/testsuite/tests/lib/should_run/length001.hs deleted file mode 100644 index 321a1b9dfc..0000000000 --- a/testsuite/tests/lib/should_run/length001.hs +++ /dev/null @@ -1,8 +0,0 @@ - -module Main (main) where - -import Data.List - -main :: IO () -main = do print (genericLength [1..10000000] :: Int) - print (genericLength [1..10000000] :: Integer) diff --git a/testsuite/tests/lib/should_run/length001.stdout b/testsuite/tests/lib/should_run/length001.stdout deleted file mode 100644 index 4e65c4e0d2..0000000000 --- a/testsuite/tests/lib/should_run/length001.stdout +++ /dev/null @@ -1,2 +0,0 @@ -10000000 -10000000 diff --git a/testsuite/tests/lib/should_run/list001.hs b/testsuite/tests/lib/should_run/list001.hs deleted file mode 100644 index c0a1eced27..0000000000 --- a/testsuite/tests/lib/should_run/list001.hs +++ /dev/null @@ -1,152 +0,0 @@ -module Main where - -import Data.List -import Control.Exception -import Prelude hiding (catch) - --- This module briefly tests all the functions in PrelList and a few --- from List. - --- ToDo: test strictness properties. - -main = do - - -- head - print (head [1,2,3,4], head "a") - catch (print (head [] :: String)) (\(ErrorCall _) -> putStr "head []\n") - - -- tail - print (tail [1,2,3,4], tail "a") - catch (print (tail [] :: String)) (\(ErrorCall _) -> putStr "tail []\n") - - -- init - print (init [1,2,3,4], init "a") - catch (print (init [] :: String)) (\(ErrorCall _) -> putStr "init []\n") - - -- last - print (last [1,2,3,4], last "a") - catch (print (last [] :: String)) (\(ErrorCall _) -> putStr "last []\n") - - -- null - print [null [], null "abc"] - - -- length - print (length [1..10]) - - -- foldl - print (foldl (+) 1 [1..10]) - - -- foldl1 - print (foldl1 (+) [1..10]) - catch (print (foldl1 (+) [] :: Int)) (\(ErrorCall _) -> putStr "foldl1 []\n") - - -- scanl - print (scanl (+) 1 [1..10]) - - -- scanl1 - print (scanl1 (+) [1..10]) - print (scanl1 (+) [] :: [Int]) - - -- foldr1 - print (foldr1 (+) [1..10]) - catch (print (foldr1 (+) [] :: Int)) (\(ErrorCall _) -> putStr "foldr1 []\n") - - -- scanr - print (scanr (+) 1 [1..10]) - - -- scanr1 - print (scanr1 (+) [1..10]) - print (scanr1 (+) [] :: [Int]) - - -- iterate - print (take 10 (cycle (take 4 (iterate (+1) 1)))) - - -- take - print (take 4 (repeat "x"), take 0 (repeat "x"), take 5 [1..4]) - catch (print (take (-1) [1..10])) (\(ErrorCall _) -> putStr "take (-1)\n") - - -- replicate - print [replicate 2 "abc", replicate 0 "abc", replicate 3 []] - - -- drop - print [drop 5 [1..10], drop 0 [1..10], drop 5 [1..4]] - catch (print (drop (-1) [1..10])) (\(ErrorCall _) -> putStr "drop (-1)\n") - - -- splitAt - print [splitAt 5 [1..10], splitAt 5 [1..4]] - catch (print (splitAt (-1) [1..10])) (\(ErrorCall _) -> putStr "splitAt (-1)\n") - - -- scan - print (span (<5) [1..10]) - - -- break - print (break (<5) [1..10]) - - -- reverse - print [reverse [1..10], reverse []] - - -- and - print [and [], and [True], and [False]] - - -- or - print [or [], or [True], or [False]] - - -- elem - print [elem 5 [1..10], elem 0 [1..10], elem 1 []] - - -- notElem - print [notElem 5 [1..10], notElem 0 [1..10], notElem 1 []] - - -- lookkup - print (lookup 4 (zip [1..10] (reverse [1..10]))) - - -- sum - print [sum [1..10], sum []] - - -- product - print [product [1..10], product []] - - -- maximum - print (maximum [1..10]) - catch (print (maximum [] :: Int)) (\(ErrorCall _) -> putStr "maximum []\n") - - -- minimum - print (minimum [1..10]) - catch (print (minimum [] :: Int)) (\(ErrorCall _) -> putStr "minimum []\n") - - -- concatMap - print (concatMap (:[]) [(1::Int)..10]) - - -- zip - print [zip [1] [2], zip [1] [], zip [] [2], zip [1..5] [2..6]] - - -- zip3 - print (zip3 [1,2] [3,4] [5,6]) - - -- zipWith - print [zipWith (+) [1,2] [3,4], zipWith (+) [1] [], zipWith (+) [] []] - - -- unzip - print [unzip [(1,2),(3,4)], unzip []] - - -- unzip3 - print [unzip3 [(1,2,3),(3,4,5)], unzip3 []] - - -- unlines - print (unlines (lines "a\nb\nc\n"), lines "", unlines []) - - -- words - print (unwords (words "a b c d"), words "", unwords []) - - -- 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 [ [0,1,1,2,3,4] \\ [3,2,1], - [1,2,3,4] \\ [], - [] \\ [error "\\\\"] ] diff --git a/testsuite/tests/lib/should_run/list001.stdout b/testsuite/tests/lib/should_run/list001.stdout deleted file mode 100644 index b8254f066e..0000000000 --- a/testsuite/tests/lib/should_run/list001.stdout +++ /dev/null @@ -1,54 +0,0 @@ -(1,'a') -"head [] -([2,3,4],"") -"tail [] -([1,2,3],"") -"init [] -(4,'a') -"last [] -[True,False] -10 -56 -55 -foldl1 [] -[1,2,4,7,11,16,22,29,37,46,56] -[1,3,6,10,15,21,28,36,45,55] -[] -55 -foldr1 [] -[56,55,53,50,46,41,35,28,20,11,1] -[55,54,52,49,45,40,34,27,19,10] -[] -[1,2,3,4,1,2,3,4,1,2] -(["x","x","x","x"],[],[1,2,3,4]) -[] -[["abc","abc"],[],["","",""]] -[[6,7,8,9,10],[1,2,3,4,5,6,7,8,9,10],[]] -[1,2,3,4,5,6,7,8,9,10] -[([1,2,3,4,5],[6,7,8,9,10]),([1,2,3,4],[])] -([],[1,2,3,4,5,6,7,8,9,10]) -([1,2,3,4],[5,6,7,8,9,10]) -([],[1,2,3,4,5,6,7,8,9,10]) -[[10,9,8,7,6,5,4,3,2,1],[]] -[True,True,False] -[False,True,False] -[True,False,False] -[False,True,True] -Just 7 -[55,0] -[3628800,1] -10 -maximum [] -1 -minimum [] -[1,2,3,4,5,6,7,8,9,10] -[[(1,2)],[],[],[(1,2),(2,3),(3,4),(4,5),(5,6)]] -[(1,3,5),(2,4,6)] -[[4,6],[],[]] -[([1,3],[2,4]),([],[])] -[([1,3],[2,4],[3,5]),([],[],[])] -("a\nb\nc\n",[],"") -("a b c d",[],"") -[[0,1,2,3,4],[]] -[[0,1,2,3,4],[]] -[[0,1,4],[1,2,3,4],[]] diff --git a/testsuite/tests/lib/should_run/list001.stdout-ghc b/testsuite/tests/lib/should_run/list001.stdout-ghc deleted file mode 100644 index 16e780ac7b..0000000000 --- a/testsuite/tests/lib/should_run/list001.stdout-ghc +++ /dev/null @@ -1,54 +0,0 @@ -(1,'a') -head [] -([2,3,4],"") -tail [] -([1,2,3],"") -init [] -(4,'a') -last [] -[True,False] -10 -56 -55 -foldl1 [] -[1,2,4,7,11,16,22,29,37,46,56] -[1,3,6,10,15,21,28,36,45,55] -[] -55 -foldr1 [] -[56,55,53,50,46,41,35,28,20,11,1] -[55,54,52,49,45,40,34,27,19,10] -[] -[1,2,3,4,1,2,3,4,1,2] -(["x","x","x","x"],[],[1,2,3,4]) -[] -[["abc","abc"],[],["","",""]] -[[6,7,8,9,10],[1,2,3,4,5,6,7,8,9,10],[]] -[1,2,3,4,5,6,7,8,9,10] -[([1,2,3,4,5],[6,7,8,9,10]),([1,2,3,4],[])] -([],[1,2,3,4,5,6,7,8,9,10]) -([1,2,3,4],[5,6,7,8,9,10]) -([],[1,2,3,4,5,6,7,8,9,10]) -[[10,9,8,7,6,5,4,3,2,1],[]] -[True,True,False] -[False,True,False] -[True,False,False] -[False,True,True] -Just 7 -[55,0] -[3628800,1] -10 -maximum [] -1 -minimum [] -[1,2,3,4,5,6,7,8,9,10] -[[(1,2)],[],[],[(1,2),(2,3),(3,4),(4,5),(5,6)]] -[(1,3,5),(2,4,6)] -[[4,6],[],[]] -[([1,3],[2,4]),([],[])] -[([1,3],[2,4],[3,5]),([],[],[])] -("a\nb\nc\n",[],"") -("a b c d",[],"") -[[0,1,2,3,4],[]] -[[0,1,2,3,4],[]] -[[0,1,4],[1,2,3,4],[]] diff --git a/testsuite/tests/lib/should_run/list002.hs b/testsuite/tests/lib/should_run/list002.hs deleted file mode 100644 index 188ff8953d..0000000000 --- a/testsuite/tests/lib/should_run/list002.hs +++ /dev/null @@ -1,6 +0,0 @@ --- !!! Test that List.sortBy is stable. - -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])) diff --git a/testsuite/tests/lib/should_run/list002.stdout b/testsuite/tests/lib/should_run/list002.stdout deleted file mode 100644 index 18e1fcad8a..0000000000 --- a/testsuite/tests/lib/should_run/list002.stdout +++ /dev/null @@ -1 +0,0 @@ -[(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10)] diff --git a/testsuite/tests/lib/should_run/list003.hs b/testsuite/tests/lib/should_run/list003.hs deleted file mode 100644 index a792094438..0000000000 --- a/testsuite/tests/lib/should_run/list003.hs +++ /dev/null @@ -1,7 +0,0 @@ --- !!! Test that length doesn't give a stack overflow - -module Main (main) where - -main :: IO () -main = print $ length $ filter odd [0 .. 9999999] - diff --git a/testsuite/tests/lib/should_run/list003.stdout b/testsuite/tests/lib/should_run/list003.stdout deleted file mode 100644 index 447a331b1b..0000000000 --- a/testsuite/tests/lib/should_run/list003.stdout +++ /dev/null @@ -1 +0,0 @@ -5000000 diff --git a/testsuite/tests/lib/should_run/memo001.hs b/testsuite/tests/lib/should_run/memo001.hs deleted file mode 100644 index 551bcd8cf4..0000000000 --- a/testsuite/tests/lib/should_run/memo001.hs +++ /dev/null @@ -1,19 +0,0 @@ -module Main(main) where - -import Memo1 - -testMemo = do - let keys = [ [1..n] | n <- [1..1000] ] - keys2 = [ [n,n-1..1] | n <- [1..1000] ] - mlength = memo length - putStr (show (map mlength (keys ++ keys ++ keys2 ++ keys2))) - putStr (show (mlength [1..100000])) - --- mlength will memoize itself over each element of 'keys', returning --- the memoized result the second time around. Then we move onto --- keys2, and while we're doing this the first lot of memo table --- entries can be purged. Finally, we do a a large computation --- (length [1..10000]) to allow time for the memo table to be fully --- purged. - -main = testMemo diff --git a/testsuite/tests/lib/should_run/memo001.stdout b/testsuite/tests/lib/should_run/memo001.stdout deleted file mode 100644 index 0e1bce9647..0000000000 --- a/testsuite/tests/lib/should_run/memo001.stdout +++ /dev/null @@ -1 +0,0 @@ -[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000]100000
\ No newline at end of file diff --git a/testsuite/tests/lib/should_run/memo002.hs b/testsuite/tests/lib/should_run/memo002.hs deleted file mode 100644 index aa0a1d27c9..0000000000 --- a/testsuite/tests/lib/should_run/memo002.hs +++ /dev/null @@ -1,30 +0,0 @@ -module Main where - -import Memo2 ( memo ) -import Data.List ( genericLength, genericReplicate ) -import System.Environment ( getArgs ) - -main :: IO () -main = do (arg:_) <- getArgs - mapM_ printTriple [ (i,fib i,mfib i) | i <- [10..read arg] ] - where printTriple (i,fi,mfi) = do print i - print fi - print mfi - putStrLn "" - --- There is not much point in memoising Integers, so we use unary "numbers" instead -mfib :: Integer -> Integer -mfib = genericLength . mfib' . flip genericReplicate () - -mfib' :: [()] -> [()] -mfib' = memo ufib - -ufib :: [()] -> [()] -ufib [] = [()] -ufib [()] = [()] -ufib (():n1@(():n2)) = mfib' n1 ++ mfib' n2 - -fib :: Integer -> Integer -fib 0 = 1 -fib 1 = 1 -fib n = fib (n-1) + fib (n-2) diff --git a/testsuite/tests/lib/should_run/memo002.stdout b/testsuite/tests/lib/should_run/memo002.stdout deleted file mode 100644 index 7369b408ef..0000000000 --- a/testsuite/tests/lib/should_run/memo002.stdout +++ /dev/null @@ -1,44 +0,0 @@ -10 -89 -89 - -11 -144 -144 - -12 -233 -233 - -13 -377 -377 - -14 -610 -610 - -15 -987 -987 - -16 -1597 -1597 - -17 -2584 -2584 - -18 -4181 -4181 - -19 -6765 -6765 - -20 -10946 -10946 - diff --git a/testsuite/tests/lib/should_run/packedstring001.hs b/testsuite/tests/lib/should_run/packedstring001.hs deleted file mode 100644 index 9ee24e232c..0000000000 --- a/testsuite/tests/lib/should_run/packedstring001.hs +++ /dev/null @@ -1,11 +0,0 @@ - -module Main (main) where - -import Char (isSpace) -import Data.PackedString - --- Bug in PackedString.lhs (fixed in rev 1.5) - -foo = packString "this is a test" -main = print (filterPS (not.isSpace) foo) - diff --git a/testsuite/tests/lib/should_run/packedstring001.stdout b/testsuite/tests/lib/should_run/packedstring001.stdout deleted file mode 100644 index fbd5abc3a0..0000000000 --- a/testsuite/tests/lib/should_run/packedstring001.stdout +++ /dev/null @@ -1 +0,0 @@ -"thisisatest" diff --git a/testsuite/tests/lib/should_run/rand001.hs b/testsuite/tests/lib/should_run/rand001.hs deleted file mode 100644 index 3567ae0dd8..0000000000 --- a/testsuite/tests/lib/should_run/rand001.hs +++ /dev/null @@ -1,22 +0,0 @@ -module Main(main) where - -import System.Random - -tstRnd rng = checkRange rng (genRnd 50 rng) - -genRnd n rng = take n (randomRs rng (mkStdGen 2)) - -checkRange (lo,hi) = all pred - where - pred - | lo <= hi = \ x -> x >= lo && x <= hi - | otherwise = \ x -> x >= hi && x <= lo - -main :: IO () -main = do - print (tstRnd (1,5::Double)) - print (tstRnd (1,5::Int)) - print (tstRnd (10,54::Integer)) - print (tstRnd ((-6),2::Int)) - print (tstRnd (2,(-6)::Int)) - diff --git a/testsuite/tests/lib/should_run/rand001.stdout b/testsuite/tests/lib/should_run/rand001.stdout deleted file mode 100644 index 2e883c51de..0000000000 --- a/testsuite/tests/lib/should_run/rand001.stdout +++ /dev/null @@ -1,5 +0,0 @@ -True -True -True -True -True diff --git a/testsuite/tests/lib/should_run/ratio001.hs b/testsuite/tests/lib/should_run/ratio001.hs deleted file mode 100644 index 4d65dfbccf..0000000000 --- a/testsuite/tests/lib/should_run/ratio001.hs +++ /dev/null @@ -1,4 +0,0 @@ -import Data.Ratio - --- !!! Test that (%) has the right fixity -main = print (2^3%5) diff --git a/testsuite/tests/lib/should_run/ratio001.stdout b/testsuite/tests/lib/should_run/ratio001.stdout deleted file mode 100644 index f7355f9a4a..0000000000 --- a/testsuite/tests/lib/should_run/ratio001.stdout +++ /dev/null @@ -1 +0,0 @@ -8 % 5 diff --git a/testsuite/tests/lib/should_run/ratio001.stdout-ghc b/testsuite/tests/lib/should_run/ratio001.stdout-ghc deleted file mode 100644 index f7355f9a4a..0000000000 --- a/testsuite/tests/lib/should_run/ratio001.stdout-ghc +++ /dev/null @@ -1 +0,0 @@ -8 % 5 diff --git a/testsuite/tests/lib/should_run/reads001.hs b/testsuite/tests/lib/should_run/reads001.hs deleted file mode 100644 index 318367e7f4..0000000000 --- a/testsuite/tests/lib/should_run/reads001.hs +++ /dev/null @@ -1,10 +0,0 @@ --- Test the classic "\SOH" ambiguity - -module Main(main) where - -main = do { print soh ; print (length (fst (head soh))) ; - 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 diff --git a/testsuite/tests/lib/should_run/reads001.stdout b/testsuite/tests/lib/should_run/reads001.stdout deleted file mode 100644 index 23639933e8..0000000000 --- a/testsuite/tests/lib/should_run/reads001.stdout +++ /dev/null @@ -1,4 +0,0 @@ -[("\SOH","")] -1 -[("\SOx","")] -2 diff --git a/testsuite/tests/lib/should_run/show001.hs b/testsuite/tests/lib/should_run/show001.hs deleted file mode 100644 index 69c27d01ea..0000000000 --- a/testsuite/tests/lib/should_run/show001.hs +++ /dev/null @@ -1,24 +0,0 @@ --- !!! Testing Show on Maybes and Eithers -module Main(main) where - -x :: Maybe () -x = Nothing - -main :: IO () -main = do - print x - print (Just ()) - print ((Just (Just ())) :: Maybe (Maybe ())) - print (Just x) - print ((Left 'a') :: Either Char Int) - print ((Right 'b') :: Either Int Char) - print ((Right x) :: Either Int (Maybe ())) - print ((Right (Just 'c')) :: Either Int (Maybe Char)) - print ((Right (Right 'd')) :: Either Int (Either Char Char)) - print ((Right (Left 'e')) :: Either Int (Either Char Int)) - print ((Left 'f') :: Either Char Int) - print ((Left x) :: Either (Maybe ()) Char) - print ((Left (Just 'g')) :: Either (Maybe Char) ()) - print ((Left (Right 'h')) :: Either (Either Int Char) Char) - print ((Left (Right 'i')) :: Either (Either Int Char) ()) - diff --git a/testsuite/tests/lib/should_run/show001.stdout b/testsuite/tests/lib/should_run/show001.stdout deleted file mode 100644 index 3be0062e87..0000000000 --- a/testsuite/tests/lib/should_run/show001.stdout +++ /dev/null @@ -1,15 +0,0 @@ -Nothing -Just () -Just (Just ()) -Just Nothing -Left 'a' -Right 'b' -Right Nothing -Right (Just 'c') -Right (Right 'd') -Right (Left 'e') -Left 'f' -Left Nothing -Left (Just 'g') -Left (Right 'h') -Left (Right 'i') diff --git a/testsuite/tests/lib/should_run/stableptr001.hs b/testsuite/tests/lib/should_run/stableptr001.hs deleted file mode 100644 index 1bc857aba6..0000000000 --- a/testsuite/tests/lib/should_run/stableptr001.hs +++ /dev/null @@ -1,19 +0,0 @@ - -module Main where - -import Foreign - --- simple test for building/dereferencing stable ptrs - -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 - return (x' + xs') diff --git a/testsuite/tests/lib/should_run/stableptr001.stdout b/testsuite/tests/lib/should_run/stableptr001.stdout deleted file mode 100644 index 90ee71a089..0000000000 --- a/testsuite/tests/lib/should_run/stableptr001.stdout +++ /dev/null @@ -1 +0,0 @@ -5000050000 diff --git a/testsuite/tests/lib/should_run/stableptr003.hs b/testsuite/tests/lib/should_run/stableptr003.hs deleted file mode 100644 index 77f4e3c9dc..0000000000 --- a/testsuite/tests/lib/should_run/stableptr003.hs +++ /dev/null @@ -1,16 +0,0 @@ -module Main where - -import Control.Monad -import System.Mem.StableName -import Control.Exception - -main = do - mapM_ evaluate list - stable_list1 <- mapM makeStableName list - stable_list2 <- mapM makeStableName list - unless (stable_list1 == stable_list2) $ do - let l1 = map hashStableName stable_list1 - let l2 = map hashStableName stable_list2 - print $ zip l1 l2 - -list = [1..10000] :: [Integer] diff --git a/testsuite/tests/lib/should_run/stableptr004.hs b/testsuite/tests/lib/should_run/stableptr004.hs deleted file mode 100644 index 2d6f567cae..0000000000 --- a/testsuite/tests/lib/should_run/stableptr004.hs +++ /dev/null @@ -1,12 +0,0 @@ -import Foreign.StablePtr - --- compile without optimisation. --- run with +RTS -D256 to see the stable pointer being garbage collected. - -main = do - let xs = [ 1 .. 50000 ] - let ys = [ 1 .. 60000 ] - s1 <- newStablePtr xs - print (sum xs) - freeStablePtr s1 - print (sum ys) diff --git a/testsuite/tests/lib/should_run/stableptr004.stdout b/testsuite/tests/lib/should_run/stableptr004.stdout deleted file mode 100644 index 30e717b5bd..0000000000 --- a/testsuite/tests/lib/should_run/stableptr004.stdout +++ /dev/null @@ -1,2 +0,0 @@ -1250025000 -1800030000 diff --git a/testsuite/tests/lib/should_run/stableptr005.hs b/testsuite/tests/lib/should_run/stableptr005.hs deleted file mode 100644 index dc4928ab6c..0000000000 --- a/testsuite/tests/lib/should_run/stableptr005.hs +++ /dev/null @@ -1,22 +0,0 @@ --- !!! triggered a temporary bug in freeStablePtr around 20020424 - -module Main where -import Foreign.StablePtr (newStablePtr, freeStablePtr) - -data Foo = A | B | C | D - -main :: IO () -main = do aSPtr <- newStablePtr A - bSPtr <- newStablePtr B - cSPtr <- newStablePtr C - cSPtr' <- newStablePtr C - freeStablePtr aSPtr - freeStablePtr bSPtr - freeStablePtr cSPtr - freeStablePtr cSPtr' - aSPtr <- newStablePtr A - bSPtr <- newStablePtr B - cSPtr <- newStablePtr C - dSPtr <- newStablePtr D - print "Hello World" - diff --git a/testsuite/tests/lib/should_run/stableptr005.stdout b/testsuite/tests/lib/should_run/stableptr005.stdout deleted file mode 100644 index 06ae699f22..0000000000 --- a/testsuite/tests/lib/should_run/stableptr005.stdout +++ /dev/null @@ -1 +0,0 @@ -"Hello World" diff --git a/testsuite/tests/lib/should_run/text001.hs b/testsuite/tests/lib/should_run/text001.hs deleted file mode 100644 index 18aab82dd9..0000000000 --- a/testsuite/tests/lib/should_run/text001.hs +++ /dev/null @@ -1,15 +0,0 @@ -{- 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. - - Fail: Prelude.read: no parse --} - -module Main where - -data Msg = Value Int | Inc deriving (Show, Read) - -main = do let v = read "Value 7"::Msg - print v - diff --git a/testsuite/tests/lib/should_run/text001.stdout b/testsuite/tests/lib/should_run/text001.stdout deleted file mode 100644 index a0c782242e..0000000000 --- a/testsuite/tests/lib/should_run/text001.stdout +++ /dev/null @@ -1 +0,0 @@ -Value 7 diff --git a/testsuite/tests/lib/should_run/tup001.hs b/testsuite/tests/lib/should_run/tup001.hs deleted file mode 100644 index a70e09027a..0000000000 --- a/testsuite/tests/lib/should_run/tup001.hs +++ /dev/null @@ -1,33 +0,0 @@ --- Test instances for tuples up to 15 --- For Read, Show, Eq, Ord, Bounded - -module Main where - -data T = A | B | C | D | E | F | G | H | I | J | K | L | M | N | O - deriving( Eq, Ord, Show, Read, Bounded ) - -t15 = (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) -t14 = (A,B,C,D,E,F,G,H,I,J,K,L,M,N) -t13 = (A,B,C,D,E,F,G,H,I,J,K,L,M) -t12 = (A,B,C,D,E,F,G,H,I,J,K,L) -t11 = (A,B,C,D,E,F,G,H,I,J,K) -t10 = (A,B,C,D,E,F,G,H,I,J) -t9 = (A,B,C,D,E,F,G,H,I) -t8 = (A,B,C,D,E,F,G,H) -t7 = (A,B,C,D,E,F,G) -t6 = (A,B,C,D,E,F) -t5 = (A,B,C,D,E) -t4 = (A,B,C,D) -t3 = (A,B,C) -t2 = (A,B) -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 diff --git a/testsuite/tests/lib/should_run/tup001.stdout b/testsuite/tests/lib/should_run/tup001.stdout deleted file mode 100644 index 540340b816..0000000000 --- a/testsuite/tests/lib/should_run/tup001.stdout +++ /dev/null @@ -1,7 +0,0 @@ -((),(A,B),(A,B,C),(A,B,C,D),(A,B,C,D,E),(A,B,C,D,E,F),(A,B,C,D,E,F,G),(A,B,C,D,E,F,G,H),(A,B,C,D,E,F,G,H,I),(A,B,C,D,E,F,G,H,I,J),(A,B,C,D,E,F,G,H,I,J,K),(A,B,C,D,E,F,G,H,I,J,K,L),(A,B,C,D,E,F,G,H,I,J,K,L,M),(A,B,C,D,E,F,G,H,I,J,K,L,M,N),(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O)) -((),(A,B),(A,B,C),(A,B,C,D),(A,B,C,D,E),(A,B,C,D,E,F),(A,B,C,D,E,F,G),(A,B,C,D,E,F,G,H),(A,B,C,D,E,F,G,H,I),(A,B,C,D,E,F,G,H,I,J),(A,B,C,D,E,F,G,H,I,J,K),(A,B,C,D,E,F,G,H,I,J,K,L),(A,B,C,D,E,F,G,H,I,J,K,L,M),(A,B,C,D,E,F,G,H,I,J,K,L,M,N),(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O)) -True -False -False -((),(A,A),(A,A,A),(A,A,A,A),(A,A,A,A,A),(A,A,A,A,A,A),(A,A,A,A,A,A,A),(A,A,A,A,A,A,A,A),(A,A,A,A,A,A,A,A,A),(A,A,A,A,A,A,A,A,A,A),(A,A,A,A,A,A,A,A,A,A,A),(A,A,A,A,A,A,A,A,A,A,A,A),(A,A,A,A,A,A,A,A,A,A,A,A,A),(A,A,A,A,A,A,A,A,A,A,A,A,A,A),(A,A,A,A,A,A,A,A,A,A,A,A,A,A,A)) -((),(O,O),(O,O,O),(O,O,O,O),(O,O,O,O,O),(O,O,O,O,O,O),(O,O,O,O,O,O,O),(O,O,O,O,O,O,O,O),(O,O,O,O,O,O,O,O,O),(O,O,O,O,O,O,O,O,O,O),(O,O,O,O,O,O,O,O,O,O,O),(O,O,O,O,O,O,O,O,O,O,O,O),(O,O,O,O,O,O,O,O,O,O,O,O,O),(O,O,O,O,O,O,O,O,O,O,O,O,O,O),(O,O,O,O,O,O,O,O,O,O,O,O,O,O,O)) diff --git a/testsuite/tests/lib/should_run/weak001.hs b/testsuite/tests/lib/should_run/weak001.hs deleted file mode 100644 index 60dc9c4a12..0000000000 --- a/testsuite/tests/lib/should_run/weak001.hs +++ /dev/null @@ -1,12 +0,0 @@ -import Foreign -import System.Mem.Weak - -kill:: Ptr a -> IO () -kill a = do - w <- mkWeakPtr a Nothing - addFinalizer a $ - deRefWeak w >> return () - -main:: IO () -main = sequence_ . take 10000 . repeat $ - mallocBytes 100 >>= kill >> return () |