Fixing a bug of TH expansion for GHC 7.6 (#92).

This commit is contained in:
Kazu Yamamoto
2013-03-16 11:50:45 +09:00
parent 33986fb1b5
commit 4a5f5441f3
5 changed files with 31 additions and 11 deletions

View File

@@ -3,7 +3,7 @@ module CheckSpec where
import CabalApi
import Check
import Cradle
import Data.List (isSuffixOf)
import Data.List (isSuffixOf, isInfixOf)
import Expectation
import Test.Hspec
import Types
@@ -23,3 +23,11 @@ spec = do
cradle <- getGHCVersion >>= findCradle Nothing . fst
res <- checkSyntax defaultOptions cradle "test/Bar/Baz.hs"
res `shouldSatisfy` ("test/Foo.hs:3:1:Warning: Top-level binding with no type signature: foo :: [Char]\NUL\n" `isSuffixOf`)
it "can detect mutually imported modules" $ do
withDirectory_ "test/data" $ do
(strVer,_) <- getGHCVersion
cradle <- findCradle Nothing strVer
res <- checkSyntax defaultOptions cradle "Mutual1.hs"
res `shouldSatisfy` ("Module imports form a cycle" `isInfixOf`)