-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add regression test showing that issue #282 does no longer exist * Add regression tests showing that issue #273 is fixed * Add regression test for issue #198
- Loading branch information
1 parent
4cbefb8
commit d786187
Showing
4 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{-# LANGUAGE OverloadedLists #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
module Language.Haskell.Stylish.Regressions | ||
( tests | ||
) where | ||
|
||
import Language.Haskell.Stylish.Step.Imports | ||
import Language.Haskell.Stylish.Tests.Util (testStep) | ||
import Test.Framework (Test, testGroup) | ||
import Test.Framework.Providers.HUnit (testCase) | ||
import Test.HUnit (Assertion, (@=?)) | ||
|
||
|
||
tests :: Test | ||
tests = testGroup "Language.Haskell.Stylish.Regressions" | ||
[ testCase "case 00 (#198)" case00 | ||
] | ||
-- | Error parsing '(,) #198 | ||
-- | ||
-- See https://github.com/haskell/stylish-haskell/issues/198 | ||
case00 :: Assertion | ||
case00 = expected @=? testStep (step (Just 80) $ importStepConfig Global) input | ||
where | ||
input = unlines | ||
[ "{-# LANGUAGE TemplateHaskell #-}" | ||
, "" | ||
, "import Language.Haskell.TH.Syntax" | ||
, "" | ||
, "main = print $ showName '(,)" | ||
] | ||
|
||
expected = input | ||
|
||
importStepConfig :: ImportAlign -> Options | ||
importStepConfig align = defaultOptions { importAlign = align } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters