diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-06-17 13:44:19 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-06-17 13:44:19 -0400 |
commit | 12a12a33789a6d191617d031963a998a479f49ba (patch) | |
tree | 0394f4b9356e7e9ae3f89f353a1fcc9fb13a056c | |
parent | b662946a474d9a616dd7af68f9893a68191b9300 (diff) |
add test case that all standard group preferred content expressions parse
-rw-r--r-- | Logs/PreferredContent.hs | 6 | ||||
-rw-r--r-- | Test.hs | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Logs/PreferredContent.hs b/Logs/PreferredContent.hs index 6c885041a..a81c16f26 100644 --- a/Logs/PreferredContent.hs +++ b/Logs/PreferredContent.hs @@ -20,6 +20,7 @@ module Logs.PreferredContent ( setStandardGroup, defaultStandardGroup, preferredRequiredMapsLoad, + prop_standardGroups_parse, ) where import qualified Data.Map as M @@ -151,3 +152,8 @@ defaultStandardGroup u g = where hasgroup = not . S.null <$> lookupGroups u haspc = isJust . M.lookup u <$> preferredContentMap + +prop_standardGroups_parse :: Bool +prop_standardGroups_parse = + all (isNothing . checkPreferredContentExpression . standardPreferredContent) + [ minBound .. maxBound] @@ -80,6 +80,7 @@ import qualified Types.Crypto import qualified Utility.Gpg #endif import qualified Messages +import qualified Logs.PreferredContent main :: [String] -> IO () main ps = do @@ -166,6 +167,7 @@ properties = localOption (QuickCheckTests 1000) $ testGroup "QuickCheck" , testProperty "prop_view_roundtrips" Annex.View.prop_view_roundtrips , testProperty "prop_viewedFile_rountrips" Annex.View.ViewedFile.prop_viewedFile_roundtrips , testProperty "prop_b64_roundtrips" Utility.Base64.prop_b64_roundtrips + , testProperty "prop_standardGroups_parse" Logs.PreferredContent.prop_standardGroups_parse ] {- These tests set up the test environment, but also test some basic parts |