test for Info.
This commit is contained in:
parent
e3f09cd476
commit
6752a8edcf
@ -72,6 +72,7 @@ Test-Suite spec
|
|||||||
CabalApiSpec
|
CabalApiSpec
|
||||||
CheckSpec
|
CheckSpec
|
||||||
FlagSpec
|
FlagSpec
|
||||||
|
InfoSpec
|
||||||
LangSpec
|
LangSpec
|
||||||
LintSpec
|
LintSpec
|
||||||
ListSpec
|
ListSpec
|
||||||
|
14
test/InfoSpec.hs
Normal file
14
test/InfoSpec.hs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module InfoSpec where
|
||||||
|
|
||||||
|
import Test.Hspec
|
||||||
|
import Expectation
|
||||||
|
import Info
|
||||||
|
import Types
|
||||||
|
|
||||||
|
spec :: Spec
|
||||||
|
spec = do
|
||||||
|
describe "typeExpr" $ do
|
||||||
|
it "shows types of the expression and its outers" $ do
|
||||||
|
withDirectory "test/data/ghc-mod-check" $ do
|
||||||
|
res <- typeExpr defaultOptions "Data.Foo" 9 5 "Data/Foo.hs"
|
||||||
|
res `shouldBe` "9 5 11 40 \"Int -> a -> a -> a\"\n7 1 11 40 \"Int -> Integer\"\n"
|
@ -2,3 +2,10 @@ module Data.Foo where
|
|||||||
|
|
||||||
foo :: Int
|
foo :: Int
|
||||||
foo = undefined
|
foo = undefined
|
||||||
|
|
||||||
|
fibonacci :: Int -> Integer
|
||||||
|
fibonacci n = fib 1 0 1
|
||||||
|
where
|
||||||
|
fib m x y
|
||||||
|
| n == m = y
|
||||||
|
| otherwise = fib (m+1) y (x + y)
|
||||||
|
Loading…
Reference in New Issue
Block a user