mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
s/EditScript/[Edit].
This commit is contained in:
parent
f8078518a0
commit
9a7a6061af
@ -9,16 +9,16 @@ spec :: Spec
|
||||
spec = do
|
||||
describe "ses" $ do
|
||||
prop "returns equal lists in These" $
|
||||
\ as -> (ses (==) as as :: EditScript Char Char) `shouldBe` zipWith These as as
|
||||
\ as -> (ses (==) as as :: [Edit Char Char]) `shouldBe` zipWith These as as
|
||||
|
||||
prop "returns deletions in This" $
|
||||
\ as -> (ses (==) as [] :: EditScript Char Char) `shouldBe` fmap This as
|
||||
\ as -> (ses (==) as [] :: [Edit Char Char]) `shouldBe` fmap This as
|
||||
|
||||
prop "returns insertions in That" $
|
||||
\ bs -> (ses (==) [] bs :: EditScript Char Char) `shouldBe` fmap That bs
|
||||
\ bs -> (ses (==) [] bs :: [Edit Char Char]) `shouldBe` fmap That bs
|
||||
|
||||
prop "returns all elements individually for disjoint inputs" $
|
||||
\ as bs -> length (ses (==) ((,) 0 <$> as :: [(Int, Char)]) ((,) 1 <$> bs :: [(Int, Char)])) `shouldBe` length as + length bs
|
||||
|
||||
prop "is lossless w.r.t. both input elements & ordering" $
|
||||
\ as bs -> foldr (\ each (as, bs) -> these (flip (,) bs. (:as)) ((,) as . (:bs)) (\ a b -> (a:as, b:bs)) each) ([], []) (ses (==) as bs :: EditScript Char Char) `shouldBe` (as, bs)
|
||||
\ as bs -> foldr (\ each (as, bs) -> these (flip (,) bs. (:as)) ((,) as . (:bs)) (\ a b -> (a:as, b:bs)) each) ([], []) (ses (==) as bs :: [Edit Char Char]) `shouldBe` (as, bs)
|
||||
|
Loading…
Reference in New Issue
Block a user