[commit: ghc] wip/fix-integer-simple-ci: ghc-compact: Use Char instead of Integer in compact_share test (5dfe989)

git at git.haskell.org git at git.haskell.org
Thu Dec 27 17:00:30 UTC 2018


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

On branch  : wip/fix-integer-simple-ci
Link       : http://ghc.haskell.org/trac/ghc/changeset/5dfe989ff19a8a17eb51166e54409c8c3e38b166/ghc

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

commit 5dfe989ff19a8a17eb51166e54409c8c3e38b166
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.


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

5dfe989ff19a8a17eb51166e54409c8c3e38b166
 libraries/ghc-compact/tests/compact_share.hs           | 5 +++--
 libraries/ghc-compact/tests/compact_share.stdout-ws-64 | 8 ++++----
 2 files changed, 7 insertions(+), 6 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-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