summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorMathew Mills <mathewmills@mac.com>2016-04-27 20:54:15 -0700
committerMathew Mills <mathewmills@mac.com>2016-04-27 20:54:15 -0700
commit586f457e6398c1b26767f00c52f037dcdf709eea (patch)
treeb366c35d864d5203f143232a0292f4670d3c4d36 /tests
parent4a6ccd2fdfbb3890eecd802ee7368c4314b7f87a (diff)
downloadstylish-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.hs12
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