diff --git a/test/Data/RandomWalkSimilarity/Spec.hs b/test/Data/RandomWalkSimilarity/Spec.hs index 034e04c5b..23f53dcd7 100644 --- a/test/Data/RandomWalkSimilarity/Spec.hs +++ b/test/Data/RandomWalkSimilarity/Spec.hs @@ -30,8 +30,9 @@ spec = parallel $ do describe "rws" $ do let compare a b = if extract a == extract b then Just (pure (Replace 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 = featureVectorDecorator (category . headF) 2 2 15 . toTerm <$> (as :: [ArbitraryTerm Text (Record '[Category])]) - tbs = featureVectorDecorator (category . headF) 2 2 15 . toTerm <$> (bs :: [ArbitraryTerm Text (Record '[Category])]) + \ (as, bs) -> let tas = toTerm' <$> (as :: [ArbitraryTerm Text (Record '[Category])]) + tbs = toTerm' <$> (bs :: [ArbitraryTerm Text (Record '[Category])]) diff = free (Free (pure (pure 0 .: Program .: RNil) :< Indexed (rws compare tas tbs))) in (beforeTerm diff, afterTerm diff) `shouldBe` (Just (cofree ((pure 0 .: Program .: RNil) :< Indexed tas)), Just (cofree ((pure 0 .: Program .: RNil) :< Indexed tbs)))