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

Use Categories for the annotations.

This commit is contained in:
Rob Rix 2016-06-28 14:09:51 -04:00
parent 88a79d736c
commit 99c36635b4

View File

@ -1,8 +1,8 @@
{-# LANGUAGE DataKinds #-}
module Data.RandomWalkSimilarity.Spec where
import Category
import Data.DList as DList hiding (toList)
import Data.Functor.Both
import Data.RandomWalkSimilarity
import Data.RandomWalkSimilarity.Arbitrary ()
import Diff
@ -32,5 +32,5 @@ spec = parallel $ do
prop "produces correct diffs" $
\ as bs -> let tas = toTerm <$> as
tbs = toTerm <$> bs
diff = free (Free (both "" "" :< Indexed (rws ((Just .) . (pure .) . Replace) identity tas tbs :: [Diff Text Text]))) in
(beforeTerm diff, afterTerm diff) `shouldBe` (Just (cofree ("" :< Indexed tas)), Just (cofree ("" :< Indexed tbs)))
diff = free (Free (pure Program :< Indexed (rws ((Just .) . (pure .) . Replace) identity tas tbs :: [Diff Text Category]))) in
(beforeTerm diff, afterTerm diff) `shouldBe` (Just (cofree (Program :< Indexed tas)), Just (cofree (Program :< Indexed tbs)))