1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00

Use the replacing combinator in the tests.

This commit is contained in:
Rob Rix 2016-08-12 09:53:16 -04:00
parent 0c47648c5b
commit 7bbbc4cbea

View File

@ -29,7 +29,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 compare a b = if ((==) `on` category . extract) a b then Just (pure (Replace a b)) else Nothing
let compare a b = if ((==) `on` category . extract) a b then Just (replacing a b) else Nothing
let toTerm' = featureVectorDecorator (category . headF) 2 2 15 . toTerm
prop "produces correct diffs" . forAll (scale (`div` 4) arbitrary) $
\ (as, bs) -> let tas = toTerm' <$> (as :: [ArbitraryTerm Text (Record '[Category])])