summaryrefslogtreecommitdiff
path: root/libraries/compact/tests/compact_share.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/compact/tests/compact_share.hs')
-rw-r--r--libraries/compact/tests/compact_share.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/libraries/compact/tests/compact_share.hs b/libraries/compact/tests/compact_share.hs
new file mode 100644
index 0000000000..73654e430b
--- /dev/null
+++ b/libraries/compact/tests/compact_share.hs
@@ -0,0 +1,14 @@
+import Data.Compact
+import Data.Compact.Internal
+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)],
+ Just y <- [Map.lookup x m1]]
+ c <- compact (m1,m2)
+ print (length (show (getCompact c)))
+ print =<< compactSize c
+ c <- compactWithSharing (m1,m2)
+ print (length (show (getCompact c)))
+ print =<< compactSize c