diff --git a/test/AlignmentSpec.hs b/test/AlignmentSpec.hs index 95c787a11..7c0c4c9a6 100644 --- a/test/AlignmentSpec.hs +++ b/test/AlignmentSpec.hs @@ -221,10 +221,6 @@ toAlignBranchInputs elements = (sources, join . (`evalState` both 0 0) . mapM go ranges = Source.actualLineRanges <$> (totalRange <$> sources) <*> sources bothContents = foldMap (modifyJoin (fromThese [] []) . fmap (:[]) . branchElementContents) -toPrettyDiff :: [BranchElement] -> PrettyDiff [(String, Range)] -toPrettyDiff elements = PrettyDiff sources (alignBranch id children ranges) - where (sources, children, ranges) = toAlignBranchInputs elements - keysOfAlignedChildren :: [Join These (Range, [(String, Range)])] -> [String] keysOfAlignedChildren lines = lines >>= these id id (++) . runJoin . fmap (fmap Prelude.fst . Prelude.snd) @@ -246,9 +242,6 @@ instance Arbitrary BranchElement where (prefix, suffix) = ('(' : key, ")" :: String) shrink (Margin contents) = Margin <$> crosswalk (shrinkList (const [])) contents -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))