mirror of
https://github.com/github/semantic.git
synced 2024-12-18 12:21:57 +03:00
Don’t convert to These.
This commit is contained in:
parent
55ee8b4f7a
commit
15fdc198bb
@ -1,6 +1,6 @@
|
|||||||
module Diffing.Algorithm.SES.Spec (spec) where
|
module Diffing.Algorithm.SES.Spec (spec) where
|
||||||
|
|
||||||
import Data.These
|
import Data.Edit
|
||||||
import Diffing.Algorithm.SES
|
import Diffing.Algorithm.SES
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.LeanCheck
|
import Test.Hspec.LeanCheck
|
||||||
@ -21,4 +21,4 @@ spec = do
|
|||||||
\ as bs -> length (ses (==) ((,) 0 <$> as :: [(Int, Char)]) ((,) 1 <$> bs :: [(Int, Char)])) `shouldBe` length as + length bs
|
\ 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" $
|
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)) (toThese each)) ([], []) (ses (==) as bs :: [Edit Char Char]) `shouldBe` (as, bs)
|
\ as bs -> foldr (\ each (as, bs) -> edit (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