1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 16:33:03 +03:00
semantic/test/InterpreterSpec.hs

23 lines
639 B
Haskell
Raw Normal View History

module InterpreterSpec where
2016-05-26 20:11:34 +03:00
import Prologue
2016-04-12 11:54:32 +03:00
import Diff
import qualified Interpreter as I
import Range
import Syntax
import Patch
2016-03-31 00:33:07 +03:00
import Info
import Category
import Test.Hspec
spec :: Spec
2016-05-04 22:15:25 +03:00
spec = parallel $
describe "interpret" $
it "returns a replacement when comparing two unicode equivalent terms" $
2016-05-04 22:15:25 +03:00
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