2015-12-16 22:18:09 +03:00
|
|
|
module InterpreterSpec where
|
|
|
|
|
|
|
|
import qualified Interpreter as I
|
|
|
|
import Range
|
|
|
|
import Syntax
|
|
|
|
import Control.Comonad.Cofree
|
|
|
|
import Control.Monad.Free
|
|
|
|
import Patch
|
|
|
|
import Diff
|
2016-02-04 21:59:33 +03:00
|
|
|
import Category
|
2015-12-16 22:18:09 +03:00
|
|
|
import Test.Hspec
|
|
|
|
|
|
|
|
spec :: Spec
|
2016-01-05 18:38:51 +03:00
|
|
|
spec = parallel $ do
|
2015-12-16 22:18:09 +03:00
|
|
|
describe "interpret" $ do
|
|
|
|
it "returns a replacement when comparing two unicode equivalent terms" $
|
|
|
|
I.interpret comparable (Info range mempty :< Leaf "t\776") (Info range2 mempty :< Leaf "\7831") `shouldBe`
|
|
|
|
Pure (Replace (Info range mempty :< Leaf "t\776") (Info range2 mempty :< Leaf "\7831"))
|
|
|
|
|
|
|
|
where
|
|
|
|
range = Range 0 2
|
|
|
|
range2 = Range 0 1
|