[commit: testsuite] master: Add encodeInteger{Double, Float} to the integerConstantFolding test (94d3e96)
Ian Lynagh
igloo at earth.li
Fri Jan 13 20:00:20 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/94d3e96a3bbcf141de4e5614632396b64c2ffc7b
>---------------------------------------------------------------
commit 94d3e96a3bbcf141de4e5614632396b64c2ffc7b
Author: Ian Lynagh <igloo at earth.li>
Date: Fri Jan 13 18:58:57 2012 +0000
Add encodeInteger{Double,Float} to the integerConstantFolding test
>---------------------------------------------------------------
tests/lib/integer/Makefile | 2 ++
tests/lib/integer/integerConstantFolding.hs | 8 ++++++++
tests/lib/integer/integerConstantFolding.stdout | 2 ++
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/tests/lib/integer/Makefile b/tests/lib/integer/Makefile
index 297f9f0..5199157 100644
--- a/tests/lib/integer/Makefile
+++ b/tests/lib/integer/Makefile
@@ -32,5 +32,7 @@ integerConstantFolding:
$(call CHECK,\<68\>,remInteger)
$(call CHECK,\<200131.0\>,doubleFromInteger)
$(call CHECK,\<200135.0\>,floatFromInteger)
+ $(call CHECK,\<400276.0\>,encodeIntegerDouble)
+ $(call CHECK,\<400280.0\>,encodeIntegerFloat)
./integerConstantFolding
diff --git a/tests/lib/integer/integerConstantFolding.hs b/tests/lib/integer/integerConstantFolding.hs
index 1fdd099..16aecfe 100644
--- a/tests/lib/integer/integerConstantFolding.hs
+++ b/tests/lib/integer/integerConstantFolding.hs
@@ -48,6 +48,8 @@ main = do p "plusInteger" plusInteger
p "remInteger" remInteger
p "doubleFromInteger" doubleFromInteger
p "floatFromInteger" floatFromInteger
+ p "encodeIntegerDouble" encodeIntegerDouble
+ p "encodeIntegerFloat" encodeIntegerFloat
where p :: Show a => String -> a -> IO ()
p str x = putStrLn (str ++ ": " ++ show x)
@@ -171,3 +173,9 @@ doubleFromInteger = fromInteger 100065 + 100066
floatFromInteger :: Float
floatFromInteger = fromInteger 100067 + 100068
+encodeIntegerDouble :: Double
+encodeIntegerDouble = encodeFloat 100069 2
+
+encodeIntegerFloat :: Float
+encodeIntegerFloat = encodeFloat 100070 2
+
diff --git a/tests/lib/integer/integerConstantFolding.stdout b/tests/lib/integer/integerConstantFolding.stdout
index 7c32328..2a241a3 100644
--- a/tests/lib/integer/integerConstantFolding.stdout
+++ b/tests/lib/integer/integerConstantFolding.stdout
@@ -42,3 +42,5 @@ quotInteger: 641
remInteger: 68
doubleFromInteger: 200131.0
floatFromInteger: 200135.0
+encodeIntegerDouble: 400276.0
+encodeIntegerFloat: 400280.0
More information about the Cvs-ghc
mailing list