mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Use the defaultFeatureVectorDecorator in the tests.
This commit is contained in:
parent
1473c10659
commit
00689650dd
@ -31,7 +31,7 @@ spec = parallel $ do
|
||||
\ (term, p, q, d) -> featureVectorDecorator (rhead . headF) (positively p) (positively q) (positively d) (toTerm term :: Term Text (Record '[Text])) `shouldSatisfy` all ((== (positively d)) . length . rhead)
|
||||
|
||||
describe "rws" $ do
|
||||
let decorate = featureVectorDecorator (category . headF) 2 3 15
|
||||
let decorate = defaultFeatureVectorDecorator (category . headF)
|
||||
let toTerm' = decorate . toTerm
|
||||
prop "produces correct diffs" . forAll (scale (`div` 4) arbitrary) $
|
||||
\ (as, bs) -> let tas = toTerm' <$> (as :: [ArbitraryTerm Text (Record '[Category])])
|
||||
|
@ -17,7 +17,7 @@ import Test.QuickCheck
|
||||
|
||||
spec :: Spec
|
||||
spec = parallel $ do
|
||||
let toTerm' = featureVectorDecorator (category . headF) 2 3 15 . toTerm
|
||||
let toTerm' = defaultFeatureVectorDecorator (category . headF) . toTerm
|
||||
prop "equality is reflexive" $
|
||||
\ a b -> let diff = diffTerms wrap (==) diffCost (toTerm' a) (toTerm' (b :: ArbitraryTerm Text (Record '[Category]))) in
|
||||
diff `shouldBe` diff
|
||||
|
@ -45,7 +45,7 @@ spec = parallel $ do
|
||||
diffSummaries sources testDiff `shouldBe` [ DiffSummary { patch = Insert (LeafInfo "string" "a"), parentAnnotation = Nothing } ]
|
||||
|
||||
prop "equal terms produce identity diffs" $
|
||||
\ a -> let term = featureVectorDecorator (category . headF) 2 3 15 (toTerm (a :: ArbitraryTerm Text (Record '[Category, Range]))) in
|
||||
\ a -> let term = defaultFeatureVectorDecorator (category . headF) (toTerm (a :: ArbitraryTerm Text (Record '[Category, Range]))) in
|
||||
diffSummaries sources (diffTerms wrap (==) diffCost term term) `shouldBe` []
|
||||
|
||||
describe "annotatedSummaries" $ do
|
||||
|
@ -18,7 +18,7 @@ import Test.Hspec.QuickCheck
|
||||
spec :: Spec
|
||||
spec = parallel $ do
|
||||
describe "interpret" $ do
|
||||
let decorate = featureVectorDecorator (category . headF) 2 3 15
|
||||
let decorate = defaultFeatureVectorDecorator (category . headF)
|
||||
let compare = ((==) `on` category . extract)
|
||||
it "returns a replacement when comparing two unicode equivalent terms" $
|
||||
let termA = cofree $ (StringLiteral .: RNil) :< Leaf ("t\776" :: Text)
|
||||
|
Loading…
Reference in New Issue
Block a user