mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
25 lines
707 B
Haskell
25 lines
707 B
Haskell
module InterpreterSpec where
|
|
|
|
import Prologue
|
|
import Diff
|
|
import qualified Interpreter as I
|
|
import Range
|
|
import Syntax
|
|
import Control.Comonad.Trans.Cofree
|
|
import Control.Monad.Trans.Free
|
|
import Patch
|
|
import Info
|
|
import Category
|
|
import Test.Hspec
|
|
|
|
spec :: Spec
|
|
spec = parallel $
|
|
describe "interpret" $
|
|
it "returns a replacement when comparing two unicode equivalent terms" $
|
|
I.interpret comparable diffCost (cofree (Info range mempty 0 :< Leaf "t\776")) (cofree (Info range2 mempty 0 :< Leaf "\7831")) `shouldBe`
|
|
free (Pure (Replace (cofree (Info range mempty 0 :< Leaf "t\776")) (cofree (Info range2 mempty 0 :< Leaf "\7831"))))
|
|
|
|
where
|
|
range = Range 0 2
|
|
range2 = Range 0 1
|