diff --git a/test/DiffSpec.hs b/test/DiffSpec.hs index 3f956d8c7..e8643412a 100644 --- a/test/DiffSpec.hs +++ b/test/DiffSpec.hs @@ -22,14 +22,14 @@ spec = parallel $ do prop "equal terms produce identity diffs" $ \ a -> let term = decorate (a :: Term Syntax (Record '[Category])) in - diffCost (diffTerms term term) `shouldBe` 0 + diffCost (diffSyntaxTerms term term) `shouldBe` 0 describe "beforeTerm" $ do prop "recovers the before term" $ - \ a b -> let diff = diffTerms a b :: Diff Syntax (Record '[Category]) (Record '[Category]) in + \ a b -> let diff = diffSyntaxTerms a b :: Diff Syntax (Record '[Category]) (Record '[Category]) in beforeTerm diff `shouldBe` Just a describe "afterTerm" $ do prop "recovers the after term" $ - \ a b -> let diff = diffTerms a b :: Diff Syntax (Record '[Category]) (Record '[Category]) in + \ a b -> let diff = diffSyntaxTerms a b :: Diff Syntax (Record '[Category]) (Record '[Category]) in afterTerm diff `shouldBe` Just b diff --git a/test/InterpreterSpec.hs b/test/InterpreterSpec.hs index e55bbc6cd..6e87c11d0 100644 --- a/test/InterpreterSpec.hs +++ b/test/InterpreterSpec.hs @@ -20,17 +20,17 @@ spec = parallel $ do it "returns a replacement when comparing two unicode equivalent terms" $ let termA = Term $ (StringLiteral :. Nil) `In` Leaf "t\776" termB = Term $ (StringLiteral :. Nil) `In` Leaf "\7831" in - diffTerms termA termB `shouldBe` replacing termA termB + diffSyntaxTerms termA termB `shouldBe` replacing termA termB prop "produces correct diffs" $ - \ a b -> let diff = diffTerms a b :: Diff Syntax (Record '[Category]) (Record '[Category]) in + \ a b -> let diff = diffSyntaxTerms a b :: Diff Syntax (Record '[Category]) (Record '[Category]) in (beforeTerm diff, afterTerm diff) `shouldBe` (Just a, Just b) prop "constructs zero-cost diffs of equal terms" $ - \ a -> let diff = diffTerms a a :: Diff Syntax (Record '[Category]) (Record '[Category]) in + \ a -> let diff = diffSyntaxTerms a a :: Diff Syntax (Record '[Category]) (Record '[Category]) in diffCost diff `shouldBe` 0 it "produces unbiased insertions within branches" $ let term s = Term ((StringLiteral :. Nil) `In` Indexed [ Term ((StringLiteral :. Nil) `In` Leaf s) ]) :: Term Syntax (Record '[Category]) root = termIn (Program :. Nil) . Indexed in - diffTerms (root [ term "b" ]) (root [ term "a", term "b" ]) `shouldBe` merge ((Program :. Nil, Program :. Nil)) (Indexed [ inserting (term "a"), cata (\ (In a r) -> merge (a, a) r) (term "b") ]) + diffSyntaxTerms (root [ term "b" ]) (root [ term "a", term "b" ]) `shouldBe` merge ((Program :. Nil, Program :. Nil)) (Indexed [ inserting (term "a"), cata (\ (In a r) -> merge (a, a) r) (term "b") ]) diff --git a/test/TOCSpec.hs b/test/TOCSpec.hs index 5f1ed880f..7e91928fd 100644 --- a/test/TOCSpec.hs +++ b/test/TOCSpec.hs @@ -48,7 +48,7 @@ spec = parallel $ do \ diff -> let diff' = (diff :: Diff Syntax () ()) in entryPayload <$> tableOfContentsBy (const (Just ())) diff' `shouldBe` replicate (diffSize diff') () prop "produces an unchanged entry for identity diffs" $ - \ term -> tableOfContentsBy (Just . termAnnotation) (diffTerms term term) `shouldBe` [Unchanged (lastValue (term :: Term Syntax (Record '[Category])))] + \ term -> tableOfContentsBy (Just . termAnnotation) (diffSyntaxTerms term term) `shouldBe` [Unchanged (lastValue (term :: Term Syntax (Record '[Category])))] prop "produces inserted/deleted/replaced entries for relevant nodes within patches" $ \ p -> tableOfContentsBy (Just . termAnnotation) (patch deleting inserting replacing p) @@ -135,7 +135,7 @@ spec = parallel $ do prop "equal terms produce identity diffs" $ \a -> let term = defaultFeatureVectorDecorator (Info.category . termAnnotation) (a :: Term') in - diffTOC (diffTerms term term) `shouldBe` [] + diffTOC (diffSyntaxTerms term term) `shouldBe` [] describe "JSONSummary" $ do it "encodes modified summaries to JSON" $ do