mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
Use the replacing
smart constructor.
This commit is contained in:
parent
0346b5d8f1
commit
86fd5b21fd
@ -24,7 +24,7 @@ spec = parallel $ do
|
|||||||
it "returns a replacement when comparing two unicode equivalent terms" $
|
it "returns a replacement when comparing two unicode equivalent terms" $
|
||||||
let termA = cofree $ (StringLiteral .: RNil) :< Leaf ("t\776" :: Text)
|
let termA = cofree $ (StringLiteral .: RNil) :< Leaf ("t\776" :: Text)
|
||||||
termB = cofree $ (StringLiteral .: RNil) :< Leaf "\7831" in
|
termB = cofree $ (StringLiteral .: RNil) :< Leaf "\7831" in
|
||||||
stripDiff (diffTerms wrap compare diffCost (decorate termA) (decorate termB)) `shouldBe` free (Pure (Replace termA termB))
|
stripDiff (diffTerms wrap compare diffCost (decorate termA) (decorate termB)) `shouldBe` replacing termA termB
|
||||||
|
|
||||||
prop "produces correct diffs" $
|
prop "produces correct diffs" $
|
||||||
\ a b -> let diff = stripDiff $ diffTerms wrap compare diffCost (decorate (toTerm a)) (decorate (toTerm (b :: ArbitraryTerm Text (Record '[Category])))) in
|
\ a b -> let diff = stripDiff $ diffTerms wrap compare diffCost (decorate (toTerm a)) (decorate (toTerm (b :: ArbitraryTerm Text (Record '[Category])))) in
|
||||||
|
Loading…
Reference in New Issue
Block a user