From db0c0eca569ecc34eb5453ef8deed8db2d04e5b8 Mon Sep 17 00:00:00 2001
From: Liyang HU <git@liyang.hu>
Date: Tue, 7 Jun 2011 16:35:18 +0900
Subject: [PATCH 4/4] QuickCheck property for differenceKeysSet

---
 tests/intmap-properties.hs |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/tests/intmap-properties.hs b/tests/intmap-properties.hs
index c2080a1..bb992ae 100644
--- a/tests/intmap-properties.hs
+++ b/tests/intmap-properties.hs
@@ -47,6 +47,7 @@ main = do
 --    q $ label   "prop_DiffValid"        prop_DiffValid
     q $ label   "prop_Diff"             prop_Diff
     q $ label   "prop_Diff2"            prop_Diff2
+    q $ label   "prop_DiffKeysSet"      prop_DiffKeysSet
 --    q $ label   "prop_IntValid"         prop_IntValid
     q $ label   "prop_Int"              prop_Int
     q $ label   "prop_Ordered"          prop_Ordered
@@ -249,6 +250,10 @@ prop_UnionWith xs ys
   = sum (elems (unionWith (+) (fromListWith (+) xs) (fromListWith (+) ys))) 
     == (sum (Prelude.map snd xs) + sum (Prelude.map snd ys))
 
+{--------------------------------------------------------------------
+  Difference
+--------------------------------------------------------------------}
+
 {-
 prop_DiffValid
   = forValidUnitTree $ \t1 ->
@@ -266,6 +271,14 @@ prop_Diff2 xs ys
   =  List.sort (keys ((\\) (fromListWith (+) xs) (fromListWith (+) ys))) 
     == List.sort ((List.\\) (List.nub (Prelude.map fst xs))  (List.nub (Prelude.map fst ys)))
 
+prop_DiffKeysSet :: Map Int -> Map () -> Bool
+prop_DiffKeysSet t1 t2
+  = difference t1 t2 == differenceKeysSet t1 (keysSet t2)
+
+{--------------------------------------------------------------------
+  Intersection
+--------------------------------------------------------------------}
+
 {-
 prop_IntValid
   = forValidUnitTree $ \t1 ->
-- 
1.7.4.1

