[commit: ghc] master: ghc-compact: Use Char instead of Integer in compact_share test (8a66496)

git at git.haskell.org git at git.haskell.org
Tue Dec 25 03:29:08 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8a664967375cc872549b21695ee3cc2b5263f3e7/ghc

>---------------------------------------------------------------

commit 8a664967375cc872549b21695ee3cc2b5263f3e7
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sun Dec 23 12:33:12 2018 -0500

    ghc-compact: Use Char instead of Integer in compact_share test
    
    The representation of Integer depends upon the choice of integer backend whereas
    Char should be consistent.


>---------------------------------------------------------------

8a664967375cc872549b21695ee3cc2b5263f3e7
 libraries/ghc-compact/tests/compact_share.hs           | 5 +++--
 libraries/ghc-compact/tests/compact_share.stdout-ws-32 | 8 ++++----
 libraries/ghc-compact/tests/compact_share.stdout-ws-64 | 8 ++++----
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/libraries/ghc-compact/tests/compact_share.hs b/libraries/ghc-compact/tests/compact_share.hs
index 323c179..5dd279c 100644
--- a/libraries/ghc-compact/tests/compact_share.hs
+++ b/libraries/ghc-compact/tests/compact_share.hs
@@ -1,9 +1,10 @@
+import Data.Char
 import GHC.Compact
 import qualified Data.Map as Map
 
 main = do
-  let m1 = Map.fromList [(x,show x) | x <- [1..(10000::Integer)]]
-      m2 = Map.fromList [(x,y) | x <- [1..(10000::Integer)],
+  let m1 = Map.fromList [(x,show x) | x <- ['a'..chr 10000]]
+      m2 = Map.fromList [(x,y) | x <- ['a'..chr 10000],
                                  Just y <- [Map.lookup x m1]]
   c <- compact (m1,m2)
   print (length (show (getCompact c)))
diff --git a/libraries/ghc-compact/tests/compact_share.stdout-ws-32 b/libraries/ghc-compact/tests/compact_share.stdout-ws-32
index a6ac978..0f92940 100644
--- a/libraries/ghc-compact/tests/compact_share.stdout-ws-32
+++ b/libraries/ghc-compact/tests/compact_share.stdout-ws-32
@@ -1,4 +1,4 @@
-275599
-1900544
-275599
-1114112
+411963
+2588672
+411963
+1343488
diff --git a/libraries/ghc-compact/tests/compact_share.stdout-ws-64 b/libraries/ghc-compact/tests/compact_share.stdout-ws-64
index 0969fdf..fffe208 100644
--- a/libraries/ghc-compact/tests/compact_share.stdout-ws-64
+++ b/libraries/ghc-compact/tests/compact_share.stdout-ws-64
@@ -1,4 +1,4 @@
-275599
-3801088
-275599
-2228224
+411963
+5177344
+411963
+2686976



More information about the ghc-commits mailing list