2013-02-13 07:22:07 +00:00
|
|
|
module InfoSpec where
|
|
|
|
|
2013-03-04 09:11:09 +00:00
|
|
|
import CabalApi
|
2013-03-02 07:14:55 +00:00
|
|
|
import Cradle
|
2013-02-13 07:22:07 +00:00
|
|
|
import Expectation
|
|
|
|
import Info
|
2013-03-02 07:14:55 +00:00
|
|
|
import Test.Hspec
|
2013-02-13 07:22:07 +00:00
|
|
|
import Types
|
|
|
|
|
|
|
|
spec :: Spec
|
|
|
|
spec = do
|
|
|
|
describe "typeExpr" $ do
|
|
|
|
it "shows types of the expression and its outers" $ do
|
2013-03-05 01:22:33 +00:00
|
|
|
withDirectory_ "test/data/ghc-mod-check" $ do
|
2013-03-04 09:11:09 +00:00
|
|
|
(strVer,_) <- getGHCVersion
|
|
|
|
cradle <- findCradle Nothing strVer
|
2013-03-02 07:14:55 +00:00
|
|
|
res <- typeExpr defaultOptions cradle "Data.Foo" 9 5 "Data/Foo.hs"
|
2013-02-13 07:22:07 +00:00
|
|
|
res `shouldBe` "9 5 11 40 \"Int -> a -> a -> a\"\n7 1 11 40 \"Int -> Integer\"\n"
|