a test case for info.
This commit is contained in:
parent
5aabca1e99
commit
b87a1e0e39
@ -31,6 +31,12 @@ spec = do
|
||||
res `shouldBe` unlines ["3 8 3 16 \"String -> IO ()\"", "3 8 3 20 \"IO ()\"", "3 1 3 20 \"IO ()\""]
|
||||
|
||||
describe "infoExpr" $ do
|
||||
it "works for non-export functions" $ do
|
||||
withDirectory_ "test/data" $ do
|
||||
cradle <- getGHCVersion >>= findCradle Nothing . fst
|
||||
res <- infoExpr defaultOptions cradle "Info" "fib" "Info.hs"
|
||||
res `shouldSatisfy` ("fib :: Int -> Int" `isPrefixOf`)
|
||||
|
||||
it "works with a module using TemplateHaskell" $ do
|
||||
withDirectory_ "test/data" $ do
|
||||
cradle <- getGHCVersion >>= findCradle Nothing . fst
|
||||
|
6
test/data/Info.hs
Normal file
6
test/data/Info.hs
Normal file
@ -0,0 +1,6 @@
|
||||
module Info () where
|
||||
|
||||
fib :: Int -> Int
|
||||
fib 0 = 0
|
||||
fib 1 = 1
|
||||
fib n = fib (n - 1) + fib (n - 2)
|
Loading…
Reference in New Issue
Block a user