fix inverted Ord for TrustLevel (intermediate commit)

This commit removes the Ord and Enum instances, commenting out all code
that depends on them, to make sure that all code effected by the
inversion fix has been identified.

(Assuming no ifdefs involve TrustLevel.)

The next commit will fix up all the identified code.
This commit is contained in:
Joey Hess 2018-04-13 14:50:14 -04:00
parent 1831cc4a7d
commit a0e4b9678b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 16 additions and 13 deletions

View file

@ -18,10 +18,8 @@ import Data.Default
import Types.UUID
-- This order may seem backwards, but we generally want to list dead
-- remotes last and trusted ones first.
data TrustLevel = Trusted | SemiTrusted | UnTrusted | DeadTrusted
deriving (Eq, Enum, Ord, Bounded, Show)
data TrustLevel = DeadTrusted | UnTrusted | SemiTrusted | Trusted
deriving (Eq, Bounded, Show)
instance Default TrustLevel where
def = SemiTrusted
@ -42,6 +40,6 @@ showTrustLevel SemiTrusted = "semitrusted"
showTrustLevel DeadTrusted = "dead"
prop_read_show_TrustLevel :: Bool
prop_read_show_TrustLevel = all check [minBound .. maxBound]
prop_read_show_TrustLevel = True -- all check [minBound .. maxBound]
where
check l = readTrustLevel (showTrustLevel l) == Just l