summaryrefslogtreecommitdiffhomepage
path: root/tests/Language/Haskell/Stylish/Step/Data/Tests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Language/Haskell/Stylish/Step/Data/Tests.hs')
-rw-r--r--tests/Language/Haskell/Stylish/Step/Data/Tests.hs20
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/Language/Haskell/Stylish/Step/Data/Tests.hs b/tests/Language/Haskell/Stylish/Step/Data/Tests.hs
index 712ffae..ff5ca3b 100644
--- a/tests/Language/Haskell/Stylish/Step/Data/Tests.hs
+++ b/tests/Language/Haskell/Stylish/Step/Data/Tests.hs
@@ -30,6 +30,7 @@ tests = testGroup "Language.Haskell.Stylish.Step.Data.Tests"
, testCase "case 17" case17
, testCase "case 18" case18
, testCase "case 19" case19
+ , testCase "case 20 (issue 262)" case20
]
case00 :: Assertion
@@ -155,7 +156,7 @@ case07 = expected @=? testStep (step 2) input
expected = input
case08 :: Assertion
-case08 = expected @=? testStep (step 2) input
+case08 = input @=? testStep (step 2) input
where
input = unlines
[ "module Herp where"
@@ -163,11 +164,6 @@ case08 = expected @=? testStep (step 2) input
, "data Phantom a ="
, " Phantom"
]
- expected = unlines
- [ "module Herp where"
- , ""
- , "data Phantom a = Phantom"
- ]
case09 :: Assertion
case09 = expected @=? testStep (step 4) input
@@ -389,3 +385,15 @@ case19 = expected @=? testStep (step 2) input
, " , age :: Int"
, " }"
]
+
+-- | Should not break Enums (data without records) formating
+--
+-- See https://github.com/jaspervdj/stylish-haskell/issues/262
+case20 :: Assertion
+case20 = input @=? testStep (step 2) input
+ where
+ input = unlines
+ [ "module Herp where"
+ , ""
+ , "data Tag = Title | Text deriving (Eq, Show)"
+ ]