Add failing test for missing warnings #507

This commit is contained in:
Daniel Gröber 2015-08-05 04:05:43 +02:00
parent 40f0e21fdf
commit 1a53582a21
3 changed files with 11 additions and 0 deletions

View File

@ -71,6 +71,7 @@ Extra-Source-Files: ChangeLog
test/data/pattern-synonyms/*.hs test/data/pattern-synonyms/*.hs
test/data/quasi-quotes/*.hs test/data/quasi-quotes/*.hs
test/data/template-haskell/*.hs test/data/template-haskell/*.hs
test/data/check-missing-warnings/*.hs
Library Library
Default-Language: Haskell2010 Default-Language: Haskell2010

View File

@ -52,3 +52,8 @@ spec = do
withDirectory_ "test/data/ghc-mod-check/lib/Data" $ do withDirectory_ "test/data/ghc-mod-check/lib/Data" $ do
res <- runD $ checkSyntax ["Foo.hs"] res <- runD $ checkSyntax ["Foo.hs"]
res `shouldBe` "" res `shouldBe` ""
it "emits warnings generated in GHC's desugar stage" $ do
withDirectory_ "test/data/check-missing-warnings" $ do
res <- runD $ checkSyntax ["DesugarWarnings.hs"]
res `shouldBe` "test/data/check-missing-warnings/DesugarWarnings.hs:5:9:Warning: Pattern match(es) are non-exhaustiveIn a case alternative: Patterns not matched: _ : _"

View File

@ -0,0 +1,5 @@
module Warnings (zoo) where
zoo :: [a] -> ()
zoo x = case x of
[] -> undefined