mirror of
https://github.com/github/semantic.git
synced 2024-12-18 12:21:57 +03:00
Merge branch 'edit-these-patch' into abstract-a-la-carte-terms
This commit is contained in:
commit
e04e24a29e
@ -157,7 +157,7 @@ instance (Listable1 syntax, Listable ann1, Listable ann2) => Listable (Diff synt
|
|||||||
|
|
||||||
|
|
||||||
instance Listable2 Edit where
|
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
|
instance (Listable a, Listable b) => Listable (Edit a b) where
|
||||||
tiers = tiers2
|
tiers = tiers2
|
||||||
|
@ -36,9 +36,9 @@ spec = do
|
|||||||
\ term -> tableOfContentsBy (Just . termFAnnotation) (diffTerms term (term :: Term ListableSyntax ())) `shouldBe` []
|
\ term -> tableOfContentsBy (Just . termFAnnotation) (diffTerms term (term :: Term ListableSyntax ())) `shouldBe` []
|
||||||
|
|
||||||
prop "produces inserted/deleted/replaced entries for relevant nodes within patches" $
|
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`
|
`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" $
|
prop "produces changed entries for relevant nodes containing irrelevant patches" $
|
||||||
\ diff -> do
|
\ diff -> do
|
||||||
|
Loading…
Reference in New Issue
Block a user