diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-19 23:43:15 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-19 23:44:08 -0400 |
commit | 0ba45a9fb578cc3fc6e8cac45034e1e5bd4fea34 (patch) | |
tree | 117a36bb444c37f6a05a49ad96153fe3991e815c /Types | |
parent | d02aab38b6d84479439ab88001f3a1f85e1940d1 (diff) |
test
Diffstat (limited to 'Types')
-rw-r--r-- | Types/TrustLevel.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Types/TrustLevel.hs b/Types/TrustLevel.hs index 83e4e5a5e..27325cd2b 100644 --- a/Types/TrustLevel.hs +++ b/Types/TrustLevel.hs @@ -10,6 +10,7 @@ module Types.TrustLevel ( TrustMap, readTrustLevel, showTrustLevel, + prop_read_show_TrustLevel ) where import qualified Data.Map as M @@ -17,7 +18,7 @@ import qualified Data.Map as M import Types.UUID data TrustLevel = Trusted | SemiTrusted | UnTrusted | DeadTrusted - deriving (Eq, Enum, Ord) + deriving (Eq, Enum, Ord, Bounded) type TrustMap = M.Map UUID TrustLevel @@ -33,3 +34,8 @@ showTrustLevel Trusted = "trusted" showTrustLevel UnTrusted = "untrusted" showTrustLevel SemiTrusted = "semitrusted" showTrustLevel DeadTrusted = "dead" + +prop_read_show_TrustLevel :: Bool +prop_read_show_TrustLevel = all check [minBound .. maxBound] + where + check l = readTrustLevel (showTrustLevel l) == Just l |