summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Logs/Trust.hs7
-rw-r--r--test.hs1
2 files changed, 8 insertions, 0 deletions
diff --git a/Logs/Trust.hs b/Logs/Trust.hs
index e5322e04e..8f568eba7 100644
--- a/Logs/Trust.hs
+++ b/Logs/Trust.hs
@@ -15,6 +15,8 @@ module Logs.Trust (
lookupTrust,
trustMapLoad,
trustMapRaw,
+
+ prop_parse_show_TrustLog,
) where
import qualified Data.Map as M
@@ -113,3 +115,8 @@ showTrustLog Trusted = "1"
showTrustLog UnTrusted = "0"
showTrustLog DeadTrusted = "X"
showTrustLog SemiTrusted = "?"
+
+prop_parse_show_TrustLog :: Bool
+prop_parse_show_TrustLog = all check [minBound .. maxBound]
+ where
+ check l = parseTrustLog (showTrustLog l) == l
diff --git a/test.hs b/test.hs
index fcd4e3136..d8653080f 100644
--- a/test.hs
+++ b/test.hs
@@ -122,6 +122,7 @@ quickcheck = TestLabel "quickcheck" $ TestList
, qctest "prop_read_show_direct" Annex.Content.Direct.prop_read_show_direct
, qctest "prop_parse_show_log" Logs.Presence.prop_parse_show_log
, qctest "prop_read_show_TrustLevel" Types.TrustLevel.prop_read_show_TrustLevel
+ , qctest "prop_parse_show_TrustLog" Logs.Trust.prop_parse_show_TrustLog
]
blackbox :: Test