@@ -78,6 +78,7 @@ tests = testGroup "Language.Haskell.Stylish.Step.Data.Tests"
78
78
, testCase " case 63 (issue #338)" case63
79
79
, testCase " case 64" case64
80
80
, testCase " case 65" case65
81
+ , testCase " case 66 (issue #411)" case66
81
82
]
82
83
83
84
case00 :: Assertion
@@ -424,7 +425,8 @@ case20 = assertSnippet (step indentIndentStyle) input input
424
425
input =
425
426
[ " module Herp where"
426
427
, " "
427
- , " data Tag = Title | Text deriving (Eq, Show)"
428
+ , " data Tag = Title | Text"
429
+ , " deriving (Eq, Show)"
428
430
]
429
431
430
432
case21 :: Assertion
@@ -1161,7 +1163,8 @@ case55 :: Assertion
1161
1163
case55 = assertSnippet (step sameSameNoSortStyle) input expected
1162
1164
where
1163
1165
input =
1164
- [ " data Foo = Foo deriving (Z, Y, X, Bar, Abcd)"
1166
+ [ " data Foo = Foo"
1167
+ , " deriving (Z, Y, X, Bar, Abcd)"
1165
1168
]
1166
1169
1167
1170
expected = input
@@ -1367,6 +1370,17 @@ case65 = assertSnippet (step indentIndentStyle) input input
1367
1370
, " deriving (Show)"
1368
1371
]
1369
1372
1373
+ -- | Deriving alignment for enums
1374
+ --
1375
+ -- Regression test for https://github.com/haskell/stylish-haskell/issues/411
1376
+ case66 :: Assertion
1377
+ case66 = assertSnippet (step indentIndentStyle) input input
1378
+ where
1379
+ input =
1380
+ [ " data Foo = A | B | C"
1381
+ , " deriving (Eq, Show)"
1382
+ ]
1383
+
1370
1384
sameSameStyle :: Config
1371
1385
sameSameStyle = Config SameLine SameLine 2 2 False True SameLine False True NoMaxColumns
1372
1386
0 commit comments