src/tests/IHaskell/Test/Parser.hs: add test for case-insensitive LANGUAGE pragmas

This commit is contained in:
Vaibhav Sagar 2018-04-26 10:46:58 +08:00
parent 0aa2bca692
commit 0b0ced3fd4

View File

@ -12,7 +12,7 @@ import Test.HUnit (assertBool, assertFailure)
import IHaskell.Test.Util (ghc, strip)
import IHaskell.Eval.Parser (parseString, getModuleName, unloc, layoutChunks, Located(..),
CodeBlock(..), DirectiveType(..), StringLoc(..))
CodeBlock(..), DirectiveType(..), StringLoc(..), PragmaType(..))
import IHaskell.Eval.ParseShell (parseShell)
#if !MIN_VERSION_base(4,8,0)
@ -197,6 +197,9 @@ testParseString = describe "Parser" $ do
"parse error (possibly incorrect indentation or mismatched brackets)"
]
it "parses LANGUAGE pragmas case-insensitively" $
parses "{-# LaNgUaGe OverloadedStrings #-}" `like` [Pragma PragmaLanguage ["OverloadedStrings"]]
it "breaks without data kinds" $
parses "data X = 3" `like` [dataKindsError]