Commit 71988f35 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-08-28 10:01:14 by simonmar]

Add two more tests:
 - arith014 tests fromIntegral behaviour on overflow
 - arith015 tests things like (read :: "Infinity" :: Double)
parent 78664bbe
......@@ -18,6 +18,8 @@ test "arith010" { vtr("-package lang", "", "") }
test "arith011" { vtr("-package lang", "", "") }
test "arith012" { vtr("-package lang", "", "") }
test "arith013" { vtr("", "", "") }
test "arith014" { vtr("", "", "") }
test "arith015" { vtr("", "", "") }
test "num001" { vtr("", "", "") }
test "num002" { vtr("", "", "") }
test "num003" { vtr("", "", "") }
......
-- Test behaviour of fromInteger when the target type is out of range.
main :: IO ()
main =
print [
fromInteger maxInt2 :: Int,
fromInteger minInt2 :: Int
]
maxInt2 = fromIntegral (maxBound :: Int) * 2 :: Integer
minInt2 = fromIntegral (minBound + 1 :: Int) * 2 :: Integer
main = do
print (map read strange_nums :: [Float])
print (map read strange_nums :: [Double])
where
strange_nums = ["Infinity","NaN"]
Supports Markdown
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