@@ -62,6 +62,9 @@ tests = testGroup "Language.Haskell.Stylish.Step.Imports.Tests"
62
62
, testCase " case 28" case28
63
63
, testCase " case 29" case29
64
64
, testCase " case 30" case30
65
+ , testCase " case 31" case31
66
+ , testCase " case 32" case32
67
+ , testCase " case 33" case33
65
68
]
66
69
67
70
@@ -190,7 +193,7 @@ case07 = assertSnippet (step (Just 80) $ fromImportAlign File)
190
193
case08 :: Assertion
191
194
case08 =
192
195
let
193
- options = Options Global WithAlias True Inline Inherit (LPConstant 4 ) True False
196
+ options = Options Global WithAlias True Inline Inherit (LPConstant 4 ) True False False
194
197
in
195
198
assertSnippet (step (Just 80 ) options) input
196
199
[ " module Herp where"
@@ -214,7 +217,7 @@ case08 =
214
217
case08b :: Assertion
215
218
case08b =
216
219
let
217
- options = Options Global WithModuleName True Inline Inherit (LPConstant 4 ) True False
220
+ options = Options Global WithModuleName True Inline Inherit (LPConstant 4 ) True False False
218
221
in
219
222
assertSnippet (step (Just 80 ) options) input
220
223
[" module Herp where"
@@ -237,7 +240,7 @@ case08b =
237
240
case09 :: Assertion
238
241
case09 =
239
242
let
240
- options = Options Global WithAlias True Multiline Inherit (LPConstant 4 ) True False
243
+ options = Options Global WithAlias True Multiline Inherit (LPConstant 4 ) True False False
241
244
in
242
245
assertSnippet (step (Just 80 ) options) input
243
246
[ " module Herp where"
@@ -272,7 +275,7 @@ case09 =
272
275
case10 :: Assertion
273
276
case10 =
274
277
let
275
- options = Options Group WithAlias True Multiline Inherit (LPConstant 4 ) True False
278
+ options = Options Group WithAlias True Multiline Inherit (LPConstant 4 ) True False False
276
279
in
277
280
assertSnippet (step (Just 40 ) options) input
278
281
[ " module Herp where"
@@ -313,7 +316,7 @@ case10 =
313
316
case11 :: Assertion
314
317
case11 =
315
318
let
316
- options = Options Group NewLine True Inline Inherit (LPConstant 4 ) True False
319
+ options = Options Group NewLine True Inline Inherit (LPConstant 4 ) True False False
317
320
in
318
321
assertSnippet (step (Just 80 ) options) input
319
322
[ " module Herp where"
@@ -340,7 +343,7 @@ case11 =
340
343
case11b :: Assertion
341
344
case11b =
342
345
let
343
- options = Options Group WithModuleName True Inline Inherit (LPConstant 4 ) True False
346
+ options = Options Group WithModuleName True Inline Inherit (LPConstant 4 ) True False False
344
347
in
345
348
assertSnippet (step (Just 80 ) options) input
346
349
[ " module Herp where"
@@ -363,7 +366,7 @@ case11b =
363
366
case12 :: Assertion
364
367
case12 =
365
368
let
366
- options = Options Group NewLine True Inline Inherit (LPConstant 2 ) True False
369
+ options = Options Group NewLine True Inline Inherit (LPConstant 2 ) True False False
367
370
in
368
371
assertSnippet (step (Just 80 ) options)
369
372
[ " import Data.List (map)"
@@ -377,7 +380,7 @@ case12 =
377
380
case12b :: Assertion
378
381
case12b =
379
382
let
380
- options = Options Group WithModuleName True Inline Inherit (LPConstant 2 ) True False
383
+ options = Options Group WithModuleName True Inline Inherit (LPConstant 2 ) True False False
381
384
in
382
385
assertSnippet (step (Just 80 ) options)
383
386
[" import Data.List (map)" ]
@@ -388,7 +391,7 @@ case12b =
388
391
case13 :: Assertion
389
392
case13 =
390
393
let
391
- options = Options None WithAlias True InlineWithBreak Inherit (LPConstant 4 ) True False
394
+ options = Options None WithAlias True InlineWithBreak Inherit (LPConstant 4 ) True False False
392
395
in
393
396
assertSnippet (step (Just 80 ) options)
394
397
[ " import qualified Data.List as List (concat, foldl, foldr, head, init,"
@@ -402,7 +405,7 @@ case13 =
402
405
case13b :: Assertion
403
406
case13b =
404
407
let
405
- options = Options None WithModuleName True InlineWithBreak Inherit (LPConstant 4 ) True False
408
+ options = Options None WithModuleName True InlineWithBreak Inherit (LPConstant 4 ) True False False
406
409
in
407
410
assertSnippet (step (Just 80 ) options)
408
411
[ " import qualified Data.List as List (concat, foldl, foldr, head, init,"
@@ -418,7 +421,7 @@ case13b =
418
421
case14 :: Assertion
419
422
case14 =
420
423
let
421
- options = Options None WithAlias True InlineWithBreak Inherit (LPConstant 10 ) True False
424
+ options = Options None WithAlias True InlineWithBreak Inherit (LPConstant 10 ) True False False
422
425
in
423
426
assertSnippet (step (Just 80 ) options)
424
427
[ " import qualified Data.List as List (concat, map, null, reverse, tail, (++))"
@@ -431,7 +434,7 @@ case14 =
431
434
case15 :: Assertion
432
435
case15 =
433
436
let
434
- options = Options None AfterAlias True Multiline Inherit (LPConstant 4 ) True False
437
+ options = Options None AfterAlias True Multiline Inherit (LPConstant 4 ) True False False
435
438
in
436
439
assertSnippet (step (Just 80 ) options)
437
440
[ " import Data.Acid (AcidState)"
@@ -456,7 +459,7 @@ case15 =
456
459
case16 :: Assertion
457
460
case16 =
458
461
let
459
- options = Options None AfterAlias True Multiline Inherit (LPConstant 4 ) False False
462
+ options = Options None AfterAlias True Multiline Inherit (LPConstant 4 ) False False False
460
463
in
461
464
assertSnippet (step (Just 80 ) options)
462
465
[ " import Data.Acid (AcidState)"
@@ -479,7 +482,7 @@ case16 =
479
482
case17 :: Assertion
480
483
case17 =
481
484
let
482
- options = Options None AfterAlias True Multiline Inherit (LPConstant 4 ) True False
485
+ options = Options None AfterAlias True Multiline Inherit (LPConstant 4 ) True False False
483
486
in
484
487
assertSnippet (step (Just 80 ) options)
485
488
[ " import Control.Applicative (Applicative ((<*>),pure))"
@@ -496,7 +499,7 @@ case17 =
496
499
case18 :: Assertion
497
500
case18 =
498
501
let
499
- options = Options None AfterAlias True InlineToMultiline Inherit (LPConstant 4 ) True False
502
+ options = Options None AfterAlias True InlineToMultiline Inherit (LPConstant 4 ) True False False
500
503
in
501
504
assertSnippet (step (Just 40 ) options)
502
505
[ " import Data.Foo as Foo (Bar, Baz, Foo)"
@@ -523,7 +526,7 @@ case18 =
523
526
case19 :: Assertion
524
527
case19 =
525
528
let
526
- options = Options Global NewLine True InlineWithBreak RightAfter (LPConstant 17 ) True False
529
+ options = Options Global NewLine True InlineWithBreak RightAfter (LPConstant 17 ) True False False
527
530
in
528
531
assertSnippet (step (Just 40 ) options) case19input
529
532
----------------------------------------
@@ -539,7 +542,7 @@ case19 =
539
542
case19b :: Assertion
540
543
case19b =
541
544
let
542
- options = Options File NewLine True InlineWithBreak RightAfter (LPConstant 17 ) True False
545
+ options = Options File NewLine True InlineWithBreak RightAfter (LPConstant 17 ) True False False
543
546
in
544
547
assertSnippet (step (Just 40 ) options) case19input
545
548
----------------------------------------
@@ -554,7 +557,7 @@ case19b =
554
557
case19c :: Assertion
555
558
case19c =
556
559
let
557
- options = Options File NewLine True InlineWithBreak RightAfter LPModuleName True False
560
+ options = Options File NewLine True InlineWithBreak RightAfter LPModuleName True False False
558
561
in
559
562
assertSnippet (step (Just 40 ) options) case19input
560
563
----------------------------------------
@@ -569,7 +572,7 @@ case19c =
569
572
case19d :: Assertion
570
573
case19d =
571
574
let
572
- options = Options Global NewLine True InlineWithBreak RightAfter LPModuleName True False
575
+ options = Options Global NewLine True InlineWithBreak RightAfter LPModuleName True False False
573
576
in
574
577
assertSnippet (step (Just 40 ) options) case19input
575
578
----------------------------------------
@@ -665,7 +668,7 @@ case22 = assertSnippet (step (Just 80) defaultOptions)
665
668
case23 :: Assertion
666
669
case23 =
667
670
let
668
- options = Options None AfterAlias False Inline Inherit (LPConstant 4 ) True True
671
+ options = Options None AfterAlias False Inline Inherit (LPConstant 4 ) True True False
669
672
in
670
673
assertSnippet (step (Just 40 ) options)
671
674
[ " import Data.Acid (AcidState)"
@@ -690,7 +693,7 @@ case23 =
690
693
case23b :: Assertion
691
694
case23b =
692
695
let
693
- options = Options None WithModuleName False Inline Inherit (LPConstant 4 ) True True
696
+ options = Options None WithModuleName False Inline Inherit (LPConstant 4 ) True True False
694
697
in
695
698
assertSnippet (step (Just 40 ) options)
696
699
[ " import Data.Acid (AcidState)"
@@ -716,7 +719,7 @@ case23b =
716
719
case24 :: Assertion
717
720
case24 =
718
721
let
719
- options = Options None AfterAlias False InlineWithBreak Inherit (LPConstant 4 ) True True
722
+ options = Options None AfterAlias False InlineWithBreak Inherit (LPConstant 4 ) True True False
720
723
in
721
724
assertSnippet (step (Just 40 ) options)
722
725
[ " import Data.Acid (AcidState)"
@@ -740,7 +743,7 @@ case24 =
740
743
case25 :: Assertion
741
744
case25 =
742
745
let
743
- options = Options Group AfterAlias False Multiline Inherit (LPConstant 4 ) False False
746
+ options = Options Group AfterAlias False Multiline Inherit (LPConstant 4 ) False False False
744
747
in
745
748
assertSnippet (step (Just 80 ) options)
746
749
[ " import Data.Acid (AcidState)"
@@ -807,7 +810,7 @@ case28 = assertSnippet (step (Just 80) $ fromImportAlign Global)
807
810
, " import Data.Set (empty, nub)"
808
811
]
809
812
[ " import Control.Monad"
810
- , " import qualified Data.Aeson as JSON"
813
+ , " import qualified Data.Aeson as JSON"
811
814
, " import Data.Default.Class (Default (def))"
812
815
, " "
813
816
, " import Data.Maybe (Maybe (Just, Nothing))"
@@ -842,3 +845,43 @@ case30 :: Assertion
842
845
case30 = assertSnippet (step Nothing defaultOptions {separateLists = False })
843
846
[" import Data.Monoid (Monoid (..))" ]
844
847
[" import Data.Monoid (Monoid(..))" ]
848
+
849
+ --------------------------------------------------------------------------------
850
+ case31 :: Assertion
851
+ case31 = assertSnippet (step Nothing defaultOptions {postQualified = True })
852
+ [" import Data.Monoid (Monoid (..))" ]
853
+ [" import Data.Monoid (Monoid (..))" ]
854
+
855
+ --------------------------------------------------------------------------------
856
+ case32 :: Assertion
857
+ case32 = assertSnippet (step Nothing defaultOptions {postQualified = True })
858
+ [" import qualified Data.Monoid as M" ]
859
+ [" import Data.Monoid qualified as M" ]
860
+
861
+ --------------------------------------------------------------------------------
862
+ case33 :: Assertion
863
+ case33 = assertSnippet (step Nothing defaultOptions {postQualified = True })
864
+ [ " import Data.Default.Class (Default(def))"
865
+ , " import qualified Data.Aeson as JSON"
866
+ , " import qualified Data.Aeson as JSON"
867
+ , " import Control.Monad"
868
+ , " import Control.Monad"
869
+ , " "
870
+ , " import Data.Maybe (Maybe (Just, Nothing))"
871
+ , " import qualified Data.Maybe.Extra (Maybe(Just, Nothing))"
872
+ , " "
873
+ , " import Data.Foo (Foo (Foo,Bar), Goo(Goo))"
874
+ , " import Data.Foo (Foo (Foo,Bar))"
875
+ , " import Data.Set (empty, intersect)"
876
+ , " import Data.Set (empty, nub)"
877
+ ]
878
+ [ " import Control.Monad"
879
+ , " import Data.Aeson qualified as JSON"
880
+ , " import Data.Default.Class (Default (def))"
881
+ , " "
882
+ , " import Data.Maybe (Maybe (Just, Nothing))"
883
+ , " import Data.Maybe.Extra (Maybe (Just, Nothing)) qualified"
884
+ , " "
885
+ , " import Data.Foo (Foo (Bar, Foo), Goo (Goo))"
886
+ , " import Data.Set (empty, intersect, nub)"
887
+ ]
0 commit comments