summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-23 12:33:12 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-24 22:23:10 -0500
commit8a664967375cc872549b21695ee3cc2b5263f3e7 (patch)
tree1c8638f34c3a1859f8b3923ad97ea1412386f18e
parent8a0fca09565df99474568888253415f9bbe0fb68 (diff)
downloadhaskell-8a664967375cc872549b21695ee3cc2b5263f3e7.tar.gz
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.
-rw-r--r--libraries/ghc-compact/tests/compact_share.hs5
-rw-r--r--libraries/ghc-compact/tests/compact_share.stdout-ws-328
-rw-r--r--libraries/ghc-compact/tests/compact_share.stdout-ws-648
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 323c179cca..5dd279cab8 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 a6ac978c74..0f92940c65 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 0969fdf956..fffe20823f 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