Transform ModuleString and Expression type synonyms into newtypes

This commit is contained in:
Sergey Vinokurov
2015-06-01 18:10:37 +03:00
parent 6a65701397
commit 7b6eb55b11
10 changed files with 27 additions and 18 deletions

View File

@@ -9,4 +9,4 @@ spec = do
describe "db <- loadSymbolDb" $ do
it "lookupSymbol' db \"head\" contains at least `Data.List'" $ do
db <- runD loadSymbolDb
lookupSym "head" db `shouldContain` ["Data.List"]
lookupSym "head" db `shouldContain` [ModuleString "Data.List"]

View File

@@ -34,17 +34,17 @@ spec = do
describe "info" $ do
it "works for non exported functions" $ do
let tdir = "test/data/non-exported"
res <- runD' tdir $ info "Fib.hs" "fib"
res <- runD' tdir $ info "Fib.hs" $ Expression "fib"
res `shouldSatisfy` ("fib :: Int -> Int" `isPrefixOf`)
it "works with a module using TemplateHaskell" $ do
let tdir = "test/data/template-haskell"
res <- runD' tdir $ info "Bar.hs" "foo"
res <- runD' tdir $ info "Bar.hs" $ Expression "foo"
res `shouldSatisfy` ("foo :: ExpQ" `isPrefixOf`)
it "works with a module that imports another module using TemplateHaskell" $ do
let tdir = "test/data/template-haskell"
res <- runD' tdir $ info "ImportsTH.hs" "bar"
res <- runD' tdir $ info "ImportsTH.hs" $ Expression "bar"
res `shouldSatisfy` ("bar :: [Char]" `isPrefixOf`)
getDistDir :: IO FilePath