@@ -54,12 +54,12 @@ tests = testGroup "Language.Haskell.Stylish.Step.Imports.Tests"
54
54
, testCase " case 21" case21
55
55
, testCase " case 22" case22
56
56
, testCase " case 23" case23
57
+ , testCase " case 23b" case23b
57
58
, testCase " case 24" case24
58
59
, testCase " case 25" case25
59
60
, testCase " case 26 (issue 185)" case26
60
61
]
61
62
62
-
63
63
--------------------------------------------------------------------------------
64
64
input :: String
65
65
input = unlines
@@ -78,7 +78,6 @@ input = unlines
78
78
, " herp = putStrLn \" import Hello world\" "
79
79
]
80
80
81
-
82
81
--------------------------------------------------------------------------------
83
82
case01 :: Assertion
84
83
case01 = expected @=? testStep (step 80 $ fromImportAlign Global ) input
@@ -100,7 +99,6 @@ case01 = expected @=? testStep (step 80 $ fromImportAlign Global) input
100
99
, " herp = putStrLn \" import Hello world\" "
101
100
]
102
101
103
-
104
102
--------------------------------------------------------------------------------
105
103
case02 :: Assertion
106
104
case02 = expected @=? testStep (step 80 $ fromImportAlign Group ) input
@@ -121,7 +119,6 @@ case02 = expected @=? testStep (step 80 $ fromImportAlign Group) input
121
119
, " herp = putStrLn \" import Hello world\" "
122
120
]
123
121
124
-
125
122
--------------------------------------------------------------------------------
126
123
case03 :: Assertion
127
124
case03 = expected @=? testStep (step 80 $ fromImportAlign None ) input
@@ -156,15 +153,13 @@ case04 = expected @=? testStep (step 80 $ fromImportAlign Global) input'
156
153
, " (.:), (.:?), (.=))"
157
154
]
158
155
159
-
160
156
--------------------------------------------------------------------------------
161
157
case05 :: Assertion
162
158
case05 = input' @=? testStep (step 80 $ fromImportAlign Group ) input'
163
159
where
164
160
input' = " import Distribution.PackageDescription.Configuration " ++
165
161
" (finalizePackageDescription)\n "
166
162
167
-
168
163
--------------------------------------------------------------------------------
169
164
case06 :: Assertion
170
165
case06 = input' @=? testStep (step 80 $ fromImportAlign File ) input'
@@ -174,7 +169,6 @@ case06 = input' @=? testStep (step 80 $ fromImportAlign File) input'
174
169
, " import Foo.Bar"
175
170
]
176
171
177
-
178
172
--------------------------------------------------------------------------------
179
173
case07 :: Assertion
180
174
case07 = expected @=? testStep (step 80 $ fromImportAlign File ) input'
@@ -213,7 +207,6 @@ case08 = expected
213
207
, " herp = putStrLn \" import Hello world\" "
214
208
]
215
209
216
-
217
210
--------------------------------------------------------------------------------
218
211
case08b :: Assertion
219
212
case08b = expected
@@ -235,7 +228,6 @@ case08b = expected
235
228
, " herp = putStrLn \" import Hello world\" "
236
229
]
237
230
238
-
239
231
--------------------------------------------------------------------------------
240
232
case09 :: Assertion
241
233
case09 = expected
@@ -269,7 +261,6 @@ case09 = expected
269
261
, " herp = putStrLn \" import Hello world\" "
270
262
]
271
263
272
-
273
264
--------------------------------------------------------------------------------
274
265
case10 :: Assertion
275
266
case10 = expected
@@ -308,7 +299,6 @@ case10 = expected
308
299
, " herp = putStrLn \" import Hello world\" "
309
300
]
310
301
311
-
312
302
--------------------------------------------------------------------------------
313
303
case11 :: Assertion
314
304
case11 = expected
@@ -423,7 +413,6 @@ case14 = expected
423
413
[ " import qualified Data.List as List (concat, map, null, reverse, tail, (++))"
424
414
]
425
415
426
-
427
416
--------------------------------------------------------------------------------
428
417
case15 :: Assertion
429
418
case15 = expected
@@ -449,7 +438,6 @@ case15 = expected
449
438
, " import qualified Herp.Derp.Internal.Types.Foobar as Internal (foo, bar)"
450
439
]
451
440
452
-
453
441
--------------------------------------------------------------------------------
454
442
case16 :: Assertion
455
443
case16 = expected
@@ -473,7 +461,6 @@ case16 = expected
473
461
, " import Data.Foo (Foo (Foo,Bar), Goo(Goo))"
474
462
]
475
463
476
-
477
464
--------------------------------------------------------------------------------
478
465
case17 :: Assertion
479
466
case17 = expected
@@ -491,7 +478,6 @@ case17 = expected
491
478
, " import Data.Identity (Identity (runIdentity,Identity))"
492
479
]
493
480
494
-
495
481
--------------------------------------------------------------------------------
496
482
case18 :: Assertion
497
483
case18 = expected @=? testStep
@@ -662,6 +648,7 @@ case22 = expected
662
648
" theLongestNameYet, shortName)"
663
649
]
664
650
651
+
665
652
--------------------------------------------------------------------------------
666
653
case23 :: Assertion
667
654
case23 = expected
@@ -686,6 +673,31 @@ case23 = expected
686
673
, " import Data.ALongName.Foo (Foo, Goo, Boo)"
687
674
]
688
675
676
+ --------------------------------------------------------------------------------
677
+ case23b :: Assertion
678
+ case23b = expected
679
+ @=? testStep (step 40 $ Options None WithModuleName False Inline Inherit (LPConstant 4 ) True True ) input'
680
+ where
681
+ expected = unlines
682
+ [ " import Data.Acid ( AcidState )"
683
+ , " import Data.Default.Class"
684
+ , " ( Default (def) )"
685
+ , " "
686
+ , " import Data.Monoid ( (<>) )"
687
+ , " "
688
+ , " import Data.ALongName.Foo ( Boo, Foo,"
689
+ , " Goo )"
690
+ ]
691
+
692
+ input' = unlines
693
+ [ " import Data.Acid (AcidState)"
694
+ , " import Data.Default.Class (Default(def))"
695
+ , " "
696
+ , " import Data.Monoid ((<>) )"
697
+ , " "
698
+ , " import Data.ALongName.Foo (Foo, Goo, Boo)"
699
+ ]
700
+
689
701
--------------------------------------------------------------------------------
690
702
case24 :: Assertion
691
703
case24 = expected
@@ -733,7 +745,6 @@ case25 = expected
733
745
, " import Data.Foo (Foo (Foo,Bar), Goo(Goo))"
734
746
]
735
747
736
-
737
748
--------------------------------------------------------------------------------
738
749
case26 :: Assertion
739
750
case26 = expected
0 commit comments