1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 04:11:48 +03:00

Merge branch 'edit-these-patch' into abstract-a-la-carte-terms

This commit is contained in:
Rob Rix 2019-10-21 12:03:35 -04:00
commit e04e24a29e
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 3 additions and 3 deletions

View File

@ -157,7 +157,7 @@ instance (Listable1 syntax, Listable ann1, Listable ann2) => Listable (Diff synt
instance Listable2 Edit where
liftTiers2 t1 t2 = liftCons1 t2 Insert \/ liftCons1 t1 Delete \/ liftCons2 t1 t2 Replace
liftTiers2 t1 t2 = liftCons1 t2 Insert \/ liftCons1 t1 Delete \/ liftCons2 t1 t2 Compare
instance (Listable a, Listable b) => Listable (Edit a b) where
tiers = tiers2

View File

@ -36,9 +36,9 @@ spec = do
\ term -> tableOfContentsBy (Just . termFAnnotation) (diffTerms term (term :: Term ListableSyntax ())) `shouldBe` []
prop "produces inserted/deleted/replaced entries for relevant nodes within patches" $
\ p -> tableOfContentsBy (Just . termFAnnotation) (patch deleting inserting comparing p)
\ p -> tableOfContentsBy (Just . termFAnnotation) (edit deleting inserting comparing p)
`shouldBe`
patch (fmap (Deleted,)) (fmap (Inserted,)) (\ as bs -> (Replaced, head bs) : fmap (Deleted,) (tail as) <> fmap (Inserted,) (tail bs)) (bimap (foldMap pure) (foldMap pure) (p :: Edit (Term ListableSyntax Int) (Term ListableSyntax Int)))
edit (fmap (Deleted,)) (fmap (Inserted,)) (\ as bs -> (Replaced, head bs) : fmap (Deleted,) (tail as) <> fmap (Inserted,) (tail bs)) (bimap (foldMap pure) (foldMap pure) (p :: Edit (Term ListableSyntax Int) (Term ListableSyntax Int)))
prop "produces changed entries for relevant nodes containing irrelevant patches" $
\ diff -> do