Commit 8a664967 authored by Ben Gamari's avatar Ben Gamari 🐢

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.
parent 8a0fca09
import Data.Char
import GHC.Compact import GHC.Compact
import qualified Data.Map as Map import qualified Data.Map as Map
main = do main = do
let m1 = Map.fromList [(x,show x) | x <- [1..(10000::Integer)]] let m1 = Map.fromList [(x,show x) | x <- ['a'..chr 10000]]
m2 = Map.fromList [(x,y) | x <- [1..(10000::Integer)], m2 = Map.fromList [(x,y) | x <- ['a'..chr 10000],
Just y <- [Map.lookup x m1]] Just y <- [Map.lookup x m1]]
c <- compact (m1,m2) c <- compact (m1,m2)
print (length (show (getCompact c))) print (length (show (getCompact c)))
......
275599 411963
1900544 2588672
275599 411963
1114112 1343488
275599 411963
3801088 5177344
275599 411963
2228224 2686976
Markdown is supported
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