From 3bb86389ed41cd2cf4e6850e085d844a25704c4d Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 11 Aug 2016 12:48:41 -0400 Subject: [PATCH] Strip the diff in the replacement of unicode equivalent terms test. --- test/InterpreterSpec.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/InterpreterSpec.hs b/test/InterpreterSpec.hs index e0f466c93..9983e41fe 100644 --- a/test/InterpreterSpec.hs +++ b/test/InterpreterSpec.hs @@ -20,9 +20,9 @@ spec = parallel $ do let decorate = featureVectorDecorator (category . headF) 2 2 15 let compare = ((==) `on` category . extract) it "returns a replacement when comparing two unicode equivalent terms" $ - let termA = decorate . cofree $ (StringLiteral .: RNil) :< Leaf ("t\776" :: Text) - termB = decorate . cofree $ (StringLiteral .: RNil) :< Leaf "\7831" in - diffTerms wrap compare diffCost termA termB `shouldBe` free (Pure (Replace termA termB)) + let termA = cofree $ (StringLiteral .: RNil) :< Leaf ("t\776" :: Text) + termB = cofree $ (StringLiteral .: RNil) :< Leaf "\7831" in + stripDiff (diffTerms wrap compare diffCost (decorate termA) (decorate termB)) `shouldBe` free (Pure (Replace termA termB)) prop "produces correct diffs" $ \ a b -> let diff = stripDiff $ diffTerms wrap compare diffCost (decorate (toTerm a)) (decorate (toTerm (b :: ArbitraryTerm Text (Record '[Category])))) in