Commit c0e36299 authored by simonpj's avatar simonpj
Browse files

[project @ 2004-08-20 08:44:06 by simonpj]

Make enum test more elaborate for Int
parent a812a211
......@@ -119,6 +119,14 @@ testEnumInt = do
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])))
......@@ -136,6 +144,19 @@ testEnumInt = do
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
......
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