diff options
| author | simonmar <unknown> | 2001-03-28 16:20:00 +0000 |
|---|---|---|
| committer | simonmar <unknown> | 2001-03-28 16:20:00 +0000 |
| commit | 758568251d27d62c2a9d6fc858d5f96b74cd9c4f (patch) | |
| tree | 93fd404aab6ef56265970fc320f2bb1744a9fac3 /ghc/tests/lib | |
| parent | 558cc120a06eb424c4ae117473d24c95851cb712 (diff) | |
| download | haskell-758568251d27d62c2a9d6fc858d5f96b74cd9c4f.tar.gz | |
[project @ 2001-03-28 16:20:00 by simonmar]
Use fromIntegral instead of fromInt/toInt.
Marcin: this test shows up some problems with enumFrom & friends on
the sized Integral types. Could you take a look? Cheers.
Diffstat (limited to 'ghc/tests/lib')
| -rw-r--r-- | ghc/tests/lib/should_run/enum03.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ghc/tests/lib/should_run/enum03.hs b/ghc/tests/lib/should_run/enum03.hs index 054698401d..0821326e86 100644 --- a/ghc/tests/lib/should_run/enum03.hs +++ b/ghc/tests/lib/should_run/enum03.hs @@ -3,7 +3,6 @@ module Main(main) where import Exception import Word -import Int( Num(fromInt), Integral(toInt) ) main = do putStrLn "Testing Enum Word8:" @@ -31,7 +30,7 @@ testEnumWord8 = do mayBomb (printTest (pred (minBound::Word8))) -- toEnum - printTest ((map (toEnum::Int->Word8) [1, toInt (minBound::Word8), toInt (maxBound::Word8)])) + printTest ((map (toEnum::Int->Word8) [1, fromIntegral (minBound::Word8)::Int, fromIntegral (maxBound::Word8)::Int])) mayBomb (printTest ((toEnum (maxBound::Int))::Word8)) -- fromEnum @@ -89,7 +88,7 @@ testEnumWord16 = do mayBomb (printTest (pred (minBound::Word16))) -- toEnum - printTest ((map (toEnum::Int->Word16) [1, toInt (minBound::Word16), toInt (maxBound::Word16)])) + printTest ((map (toEnum::Int->Word16) [1, fromIntegral (minBound::Word16)::Int, fromIntegral (maxBound::Word16)::Int])) mayBomb (printTest ((toEnum (maxBound::Int))::Word16)) @@ -148,11 +147,11 @@ testEnumWord32 = do mayBomb (printTest (pred (minBound::Word32))) -- toEnum - printTest ((map (toEnum::Int->Word32) [1, toInt (minBound::Word32), maxBound::Int])) + printTest ((map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, maxBound::Int])) mayBomb (printTest ((toEnum (maxBound::Int))::Word32)) -- fromEnum - printTest ((map fromEnum [(1::Word32),minBound,fromInt (maxBound::Int)])) + printTest ((map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)])) mayBomb (printTest (fromEnum (maxBound::Word32))) -- [x..] aka enumFrom @@ -207,11 +206,11 @@ testEnumWord64 = do mayBomb (printTest (pred (minBound::Word64))) -- toEnum - printTest ((map (toEnum::Int->Word64) [1, toInt (minBound::Word64), maxBound::Int])) + 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,fromInt (maxBound::Int)])) + printTest ((map fromEnum [(1::Word64),minBound,fromIntegral (maxBound::Int)])) mayBomb (printTest (fromEnum (maxBound::Word64))) -- [x..] aka enumFrom |
