1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Implement construction of arbitrary PrettyDiffs.

This commit is contained in:
Rob Rix 2016-05-24 13:04:28 -04:00
parent e0e7f0fa4a
commit a594f54279

View File

@ -244,6 +244,9 @@ instance Arbitrary BranchElement where
instance Show BranchElement where
show = show . branchElementContents
instance Arbitrary (PrettyDiff [(String, Range)]) where
arbitrary = toPrettyDiff <$> listOf1 arbitrary
counts :: [Join These (Int, a)] -> Both Int
counts numbered = fromMaybe 0 . getLast . mconcat . fmap Last <$> Join (unalign (runJoin . fmap Prelude.fst <$> numbered))