Commit 073b36bf authored by simonpj's avatar simonpj

[project @ 2005-03-10 12:03:41 by simonpj]

Add test for tuple instances
parent 20ab9c35
......@@ -8,6 +8,8 @@ test('read001', 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 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
((),(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))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment