Commit 805e7047 authored by igloo's avatar igloo
Browse files

[project @ 2004-07-19 22:11:45 by igloo]

Allows a -ws-64 stdout variant rather than requiring each 64-bit
platform to have a -platform one. (You now need to make boot in
testsuite after configure but before running tests).

Modify enum001, partly to alter spacing but also to inline printTest
where things like \NUL are used, as modern cpp behaves differently.

Rename the generated .script files to .genscript to make it easier to
clean a testsuite tree.
parent 6aa59ddf
TOP = .
include $(TOP)/mk/boilerplate.mk
all boot ::
CLEAN_FILES += mk/wordsize.mk
all ::
@echo "To run the tests, go into tests/ghc-regress and say \`make'."
@echo "More information about configuring and running the testsuite"
@echo "can be found in the file \`README' in this directory."
boot ::
$(CPP) $(RAWCPP_FLAGS) -x c mk/wordsize.mk.in > mk/wordsize.mk
include $(TOP)/mk/target.mk
......@@ -41,6 +41,9 @@ class TestConfig:
# What platform are we running on?
self.platform = ''
# What is the wordsize (in bits) of this platform?
self.wordsize = ''
# Verbosity level
self.verbose = 1
......@@ -415,7 +418,7 @@ def do_compile( name, way, should_fail, top_mod, extra_hc_opts ):
# of whether we expected the compilation to fail or not (successful
# compilations may generate warnings).
expected_stderr_file = platform_qualify(name, 'stderr')
expected_stderr_file = platform_wordsize_qualify(name, 'stderr')
actual_stderr_file = qualify(name, 'comp.stderr')
actual_stderr = normalise_errmsg(open(actual_stderr_file).read())
......@@ -575,7 +578,7 @@ def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ):
else:
srcname = top_mod
scriptname = add_suffix(name, 'script')
scriptname = add_suffix(name, 'genscript')
qscriptname = in_testdir(scriptname)
rm_no_fail(qscriptname)
......@@ -753,7 +756,7 @@ def extcore_run( name, way, extra_hc_opts, compile_only, top_mod ):
def check_stdout_ok( name ):
actual_stdout_file = qualify(name, 'run.stdout')
expected_stdout_file = platform_qualify(name, 'stdout')
expected_stdout_file = platform_wordsize_qualify(name, 'stdout')
if os.path.exists(expected_stdout_file):
expected_stdout = open(expected_stdout_file).read()
......@@ -778,7 +781,7 @@ def check_stdout_ok( name ):
def check_stderr_ok( name ):
actual_stderr_file = qualify(name, 'run.stderr')
expected_stderr_file = platform_qualify(name, 'stderr')
expected_stderr_file = platform_wordsize_qualify(name, 'stderr')
if os.path.exists(expected_stderr_file):
expected_stderr = open(expected_stderr_file).read()
......@@ -883,12 +886,16 @@ def in_testdir( name ):
def qualify( name, suff ):
return in_testdir(add_suffix(name, suff))
# "foo" -> qualify("foo-platform") if it exists, or qualify("foo") otherwise
def platform_qualify( name, suff ):
# "foo" -> qualify("foo-platform") if it exists, otherwise
# try qualify("foo-ws-wordsize") or finally qualify("foo")
def platform_wordsize_qualify( name, suff ):
path = qualify(name, suff)
platform_path = path + '-' + config.platform
wordsize_path = path + '-ws-' + config.wordsize
if os.path.exists(platform_path):
return platform_path
elif os.path.exists(wordsize_path):
return wordsize_path
else:
return path
......
......@@ -15,6 +15,8 @@
#
# -----------------------------------------------------------------------------
include $(TOP)/mk/wordsize.mk
ifeq "$(PYTHON)" ""
$(error Python must be installed in order to use the testsuite)
endif
......@@ -64,6 +66,7 @@ RUNTEST_OPTS += \
-e config.compiler=\"$(TEST_HC)\" \
-e config.compiler_always_flags.append"(\"$(EXTRA_HC_OPTS)\")" \
-e config.platform=\"$(TARGETPLATFORM)\" \
-e config.wordsize=\"$(WORDSIZE)\" \
$(EXTRA_RUNTEST_OPTS)
TESTS =
......
#include "../../ghc/includes/MachDeps.h"
WORDSIZE = WORD_SIZE_IN_BITS
343023920121
3430239
1212
1143376523
-111
232189458241
[(343023920121,"")]
[(3430239,"")]
[(1212,"")]
[(1143376523,"")]
[(-111,"")]
[(232189458241,"")]
[(343023920121,"")]
[(3430239,"")]
[(0,"")]
[(1143376523,"")]
[(-111,"")]
[(232189458241,"")]
(readDec::ReadS Integer) 3489348394032498320438240938403 = [(3489348394032498320438240938403,"")]
(readDec::ReadS Integer) 0 = [(0,"")]
(readDec::ReadS Integer) -1 = []
(readDec::ReadS Integer) 1 = [(1,"")]
(readDec::ReadS Integer) 34323 = [(34323,"")]
(readDec::ReadS Integer) 2L = [(2,"L")]
(readDec::ReadS Integer) 012 = [(12,"")]
(readDec::ReadS Integer) 0x23 = [(0,"x23")]
(readDec::ReadS Integer) 3243ab = [(3243,"ab")]
(readDec::ReadS Int) 3489348394032498320438240938403 = [(8154046292665502115,"")]
(readDec::ReadS Int) 0 = [(0,"")]
(readDec::ReadS Int) -1 = []
(readDec::ReadS Int) 1 = [(1,"")]
(readDec::ReadS Int) 34323 = [(34323,"")]
(readDec::ReadS Int) 2L = [(2,"L")]
(readDec::ReadS Int) 012 = [(12,"")]
(readDec::ReadS Int) 0x23 = [(0,"x23")]
(readDec::ReadS Int) 3243ab = [(3243,"ab")]
(readOct::ReadS Integer) 3489348394032498320438240938403 = [(28,"89348394032498320438240938403")]
(readOct::ReadS Integer) 0 = [(0,"")]
(readOct::ReadS Integer) -1 = []
(readOct::ReadS Integer) 1 = [(1,"")]
(readOct::ReadS Integer) 34323 = [(14547,"")]
(readOct::ReadS Integer) 2L = [(2,"L")]
(readOct::ReadS Integer) 012 = [(10,"")]
(readOct::ReadS Integer) 0x23 = [(0,"x23")]
(readOct::ReadS Integer) 3243ab = [(1699,"ab")]
(readOct::ReadS Int) 3489348394032498320438240938403 = [(28,"89348394032498320438240938403")]
(readOct::ReadS Int) 0 = [(0,"")]
(readOct::ReadS Int) -1 = []
(readOct::ReadS Int) 1 = [(1,"")]
(readOct::ReadS Int) 34323 = [(14547,"")]
(readOct::ReadS Int) 2L = [(2,"L")]
(readOct::ReadS Int) 012 = [(10,"")]
(readOct::ReadS Int) 0x23 = [(0,"x23")]
(readOct::ReadS Int) 3243ab = [(1699,"ab")]
(readHex::ReadS Integer) 3489348394032498320438240938403 = [(4364516597526947317207336190131536899,"")]
(readHex::ReadS Integer) 0 = [(0,"")]
(readHex::ReadS Integer) -1 = []
(readHex::ReadS Integer) 1 = [(1,"")]
(readHex::ReadS Integer) 34323 = [(213795,"")]
(readHex::ReadS Integer) 2L = [(2,"L")]
(readHex::ReadS Integer) 012 = [(18,"")]
(readHex::ReadS Integer) 0x23 = [(0,"x23")]
(readHex::ReadS Integer) 3243ab = [(3294123,"")]
(readHex::ReadS Int) 3489348394032498320438240938403 = [(-8998117828778032125,"")]
(readHex::ReadS Int) 0 = [(0,"")]
(readHex::ReadS Int) -1 = []
(readHex::ReadS Int) 1 = [(1,"")]
(readHex::ReadS Int) 34323 = [(213795,"")]
(readHex::ReadS Int) 2L = [(2,"L")]
(readHex::ReadS Int) 012 = [(18,"")]
(readHex::ReadS Int) 0x23 = [(0,"x23")]
(readHex::ReadS Int) 3243ab = [(3294123,"")]
......@@ -161,8 +161,10 @@ testEnumChar = do
printTest ((map fromEnum ['X',minBound,maxBound]))
-- [x..] aka enumFrom
printTest ((take 7 ['\NUL' .. ]))
printTest ((take 7 ['\250' .. ]))
-- 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'..]))
......@@ -171,19 +173,24 @@ testEnumChar = do
printTest ((take 7 ['z','y'..]))
printTest ((take 7 ['z','v'..]))
let x = '\1'
printTest ((take 7 ['\1', '\0' ..]))
-- printTest ((take 7 ['\1', '\0' ..]))
do{ putStr ( " " ++ "(take 7 ['\\1', '\\0' ..])" ++ " = " ) ; print (take 7 ['\1', '\0' ..]) }
let x = '\5'
printTest ((take 7 ['\5', '\4' ..]))
-- 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' ..]))
-- 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'])))
printTest ((take 7 (['\5' .. '\0'])))
-- 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']))
......@@ -193,8 +200,10 @@ testEnumChar = do
printTest ((take 7 ['c','b' .. 'c']))
printTest ((take 7 ['c','b' .. 'b']))
printTest ((take 7 ['c','d' .. 'b']))
printTest ((take 7 ['\251', '\252' .. maxBound]))
printTest ((take 7 ['\5', '\4' .. minBound]))
-- 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 ()
......@@ -323,8 +332,8 @@ testEnumBool = do
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]))
printTest (take 7 ([True,True .. False]))
printTest (take 7 ([True,True .. True]))
testEnumInteger :: IO ()
......
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 argment"
(succ (minBound::())) = error "Prelude.Enum.().succ: bad argment"
(succ (maxBound::())) = error "Prelude.Enum.().succ: bad argment"
(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
([()..]) = [()]
([(),()..]) = [()]
([()..()]) = [()]
([(),()..()]) = [()]
Testing Enum Ordering (derived):
(succ LT) = EQ
(succ (minBound::Ordering)) = EQ
(succ (maxBound::Ordering)) = error "Prelude.Enum.Ordering.succ: bad argment"
(pred GT) = EQ
(pred (maxBound::Ordering)) = EQ
(pred (minBound::Ordering)) = error "Prelude.Enum.Ordering.pred: bad argment"
(toEnum 0)::Ordering = LT
(toEnum 5)::Ordering = error "Prelude.Enum.Ordering.toEnum: bad argment"
(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 argment"
(pred True) = False
(pred (maxBound::Bool)) = False
(pred (minBound::Bool)) = error "Prelude.Enum.Bool.pred: bad argment"
(toEnum 0)::Bool = False
(toEnum 5)::Bool = error "Prelude.Enum.Bool.toEnum: bad argment"
(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]
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]