Just x -> if x /= v
then (k, x) : accum
else accum
- masterChanges = map (pairToFunc ModifyContent) . catMaybes .
- map checkIt . Map.toList . Map.intersection child
- $ master
- where checkIt (k, v) =
- case Map.lookup k master of
- Nothing -> Nothing
- Just v' -> if v /= v'
- then Just (k, v)
- else Nothing
- in (sort masterChanges, expectedResChild) @=?
+ in ([], expectedResChild) @=?
(sort resMaster, sort resChild)
prop_allChangesToMaster :: SyncCollection Int Word8 -> SyncCollection Int Word8 -> Result
newcoll2 = unaryApplyChanges coll1 commands
in coll2 @=? newcoll2
+prop_modifyToSyncSimple :: SyncCollection Int Word8 -> Word8 -> Result
+prop_modifyToSyncSimple base newv
+ | Map.empty base = True @=? True
+ | otherwise = ([], [], [ModifyContent @=?
+ where k = fst . head . Map.toList base
+prop_modifyToSync
+
q :: Testable a => String -> a -> HU.Test
q = qccheck (defaultConfig {configMaxTest = 250})