quickcheck property for parsing of content identifier logs

This commit is contained in:
Joey Hess 2019-02-21 12:22:50 -04:00
parent 7c25cc7715
commit 936aee6a60
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 40 additions and 16 deletions

View file

@ -20,6 +20,7 @@ module Logs.MapLog (
import Common
import Annex.VectorClock
import Logs.Line
import Utility.QuickCheck
import qualified Data.ByteString.Lazy as L
import qualified Data.Map.Strict as M
@ -32,6 +33,9 @@ data LogEntry v = LogEntry
, value :: v
} deriving (Eq, Show)
instance Arbitrary v => Arbitrary (LogEntry v) where
arbitrary = LogEntry <$> arbitrary <*> arbitrary
type MapLog f v = M.Map f (LogEntry v)
buildMapLog :: (f -> Builder) -> (v -> Builder) -> MapLog f v -> Builder