]> code.delx.au - offlineimap/commitdiff
Fixed unaryApplyChanges test
authorJohn Goerzen <jgoerzen@complete.org>
Wed, 28 May 2008 10:35:17 +0000 (05:35 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Wed, 28 May 2008 10:35:17 +0000 (05:35 -0500)
testsrc/runtests.hs

index aa73fc3bb3c2cf03ecd12a0ec83c0bdd36936bd0..d5a285a1ec0dcaca5b7f0f39032a8240fa35552d 100644 (file)
@@ -97,10 +97,9 @@ prop_unaryApplyChanges collection randcommands =
         addedKeys = catMaybes . map (\x -> case x of CopyItem y -> Just y; _ -> Nothing) $ commands
         deletedKeys = catMaybes . map (\x -> case x of DeleteItem y -> Just y; _ -> Nothing) $ commands
         
+        collection' = Map.difference collection (keysToMap deletedKeys)
         expectedCollection = 
-            Map.union
-                   (Map.difference collection (keysToMap deletedKeys))
-                   (Map.intersection collection (keysToMap addedKeys))
+            Map.union collection' (keysToMap addedKeys)
         in (sort . Map.keys $ expectedCollection) @=?
            (sort . Map.keys $ unaryApplyChanges collection commands)