diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-12 22:27:55 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-12 22:27:55 -0400 |
commit | 406402220e50a6aea2e73c61693b0a93bfae9f38 (patch) | |
tree | b8f3bfb9be7fc58d1bdf90b0de1883b50bee4cad /Types | |
parent | 70aef104847247accc8da34e77c096672737a63f (diff) |
fix metadata log simplifier and additional quickcheck tests
Diffstat (limited to 'Types')
-rw-r--r-- | Types/MetaData.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Types/MetaData.hs b/Types/MetaData.hs index 53a9b6944..c701731c9 100644 --- a/Types/MetaData.hs +++ b/Types/MetaData.hs @@ -29,7 +29,7 @@ module Types.MetaData ( getAllMetaData, serialize, deserialize, - prop_updateMetaData_sane, + prop_metadata_sane, prop_metadata_serialize ) where @@ -199,10 +199,13 @@ instance Arbitrary MetaValue where instance Arbitrary MetaField where arbitrary = MetaField <$> arbitrary `suchThat` legalField -prop_updateMetaData_sane :: MetaData -> MetaField -> MetaValue -> Bool -prop_updateMetaData_sane m f v = and +prop_metadata_sane :: MetaData -> MetaField -> MetaValue -> Bool +prop_metadata_sane m f v = and [ S.member v $ getAllMetaData f m' , not (isSet v) || S.member v (currentMetaDataValues f m') + , not (hasUniqueMetaData m m) + , hasUniqueMetaData newMetaData m' + , not (hasUniqueMetaData m' newMetaData) ] where m' = updateMetaData f v m |