diff options
author | Mathew Mills <mathewmills@mac.com> | 2016-04-27 20:54:15 -0700 |
---|---|---|
committer | Mathew Mills <mathewmills@mac.com> | 2016-04-27 20:54:15 -0700 |
commit | 586f457e6398c1b26767f00c52f037dcdf709eea (patch) | |
tree | b366c35d864d5203f143232a0292f4670d3c4d36 /tests | |
parent | 4a6ccd2fdfbb3890eecd802ee7368c4314b7f87a (diff) | |
download | stylish-haskell-586f457e6398c1b26767f00c52f037dcdf709eea.tar.gz |
Remove shebang from input before attempting to extract extension pragmas.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Language/Haskell/Stylish/Parse/Tests.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/Language/Haskell/Stylish/Parse/Tests.hs b/tests/Language/Haskell/Stylish/Parse/Tests.hs index d5f3c1d..87c0a51 100644 --- a/tests/Language/Haskell/Stylish/Parse/Tests.hs +++ b/tests/Language/Haskell/Stylish/Parse/Tests.hs @@ -1,4 +1,3 @@ --------------------------------------------------------------------------------- module Language.Haskell.Stylish.Parse.Tests ( tests ) where @@ -22,8 +21,19 @@ tests = testGroup "Language.Haskell.Stylish.Parse" , testCase "Multiline CPP" testMultilineCpp , testCase "Haskell2010 extension" testHaskell2010 , testCase "Shebang" testShebang + , testCase "ShebangExt" testShebangExt ] +-------------------------------------------------------------------------------- +testShebangExt :: Assertion +testShebangExt = assert $ isRight $ parseModule [] Nothing input + where + input = unlines + [ "#!env runghc" + , "{-# LANGUAGE CPP #-}" + , "#define foo bar \\" + , " qux" + ] -------------------------------------------------------------------------------- testBom :: Assertion |