From d5d03ca67c26960b53dd625493004c2df1a84125 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 23 Aug 2016 12:33:29 +0200 Subject: Export Import options & add default --- .../Language/Haskell/Stylish/Step/Imports/Tests.hs | 39 ++++++++++------------ 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'tests') diff --git a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs index 3a839cb..5ca60de 100644 --- a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs +++ b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs @@ -15,14 +15,11 @@ import Language.Haskell.Stylish.Step.Imports import Language.Haskell.Stylish.Tests.Util --------------------------------------------------------------------------------- -defaultAlign :: Align -defaultAlign = Align Global AfterAlias Inline Inherit (LPConstant 4) True - -------------------------------------------------------------------------------- -fromImportAlign :: ImportAlign -> Align -fromImportAlign align = defaultAlign { importAlign = align } +fromImportAlign :: ImportAlign -> Options +fromImportAlign align = defaultOptions { importAlign = align } + -------------------------------------------------------------------------------- tests :: Test @@ -188,7 +185,7 @@ case07 = expected @=? testStep (step 80 $ fromImportAlign File) input' -------------------------------------------------------------------------------- case08 :: Assertion case08 = expected - @=? testStep (step 80 $ Align Global WithAlias Inline Inherit (LPConstant 4) True) input + @=? testStep (step 80 $ Options Global WithAlias Inline Inherit (LPConstant 4) True) input where expected = unlines [ "module Herp where" @@ -211,7 +208,7 @@ case08 = expected -------------------------------------------------------------------------------- case09 :: Assertion case09 = expected - @=? testStep (step 80 $ Align Global WithAlias Multiline Inherit (LPConstant 4) True) input + @=? testStep (step 80 $ Options Global WithAlias Multiline Inherit (LPConstant 4) True) input where expected = unlines [ "module Herp where" @@ -245,7 +242,7 @@ case09 = expected -------------------------------------------------------------------------------- case10 :: Assertion case10 = expected - @=? testStep (step 40 $ Align Group WithAlias Multiline Inherit (LPConstant 4) True) input + @=? testStep (step 40 $ Options Group WithAlias Multiline Inherit (LPConstant 4) True) input where expected = unlines [ "module Herp where" @@ -284,7 +281,7 @@ case10 = expected -------------------------------------------------------------------------------- case11 :: Assertion case11 = expected - @=? testStep (step 80 $ Align Group NewLine Inline Inherit (LPConstant 4) True) input + @=? testStep (step 80 $ Options Group NewLine Inline Inherit (LPConstant 4) True) input where expected = unlines [ "module Herp where" @@ -312,7 +309,7 @@ case11 = expected -------------------------------------------------------------------------------- case12 :: Assertion case12 = expected - @=? testStep (step 80 $ Align Group NewLine Inline Inherit (LPConstant 2) True) input' + @=? testStep (step 80 $ Options Group NewLine Inline Inherit (LPConstant 2) True) input' where input' = unlines [ "import Data.List (map)" @@ -327,7 +324,7 @@ case12 = expected -------------------------------------------------------------------------------- case13 :: Assertion case13 = expected - @=? testStep (step 80 $ Align None WithAlias InlineWithBreak Inherit (LPConstant 4) True) input' + @=? testStep (step 80 $ Options None WithAlias InlineWithBreak Inherit (LPConstant 4) True) input' where input' = unlines [ "import qualified Data.List as List (concat, foldl, foldr, head, init," @@ -345,7 +342,7 @@ case13 = expected case14 :: Assertion case14 = expected @=? testStep - (step 80 $ Align None WithAlias InlineWithBreak Inherit (LPConstant 10) True) expected + (step 80 $ Options None WithAlias InlineWithBreak Inherit (LPConstant 10) True) expected where expected = unlines [ "import qualified Data.List as List (concat, map, null, reverse, tail, (++))" @@ -355,7 +352,7 @@ case14 = expected -------------------------------------------------------------------------------- case15 :: Assertion case15 = expected - @=? testStep (step 80 $ Align None AfterAlias Multiline Inherit (LPConstant 4) True) input' + @=? testStep (step 80 $ Options None AfterAlias Multiline Inherit (LPConstant 4) True) input' where expected = unlines [ "import Data.Acid (AcidState)" @@ -381,7 +378,7 @@ case15 = expected -------------------------------------------------------------------------------- case16 :: Assertion case16 = expected - @=? testStep (step 80 $ Align None AfterAlias Multiline Inherit (LPConstant 4) False) input' + @=? testStep (step 80 $ Options None AfterAlias Multiline Inherit (LPConstant 4) False) input' where expected = unlines [ "import Data.Acid (AcidState)" @@ -405,7 +402,7 @@ case16 = expected -------------------------------------------------------------------------------- case17 :: Assertion case17 = expected - @=? testStep (step 80 $ Align None AfterAlias Multiline Inherit (LPConstant 4) True) input' + @=? testStep (step 80 $ Options None AfterAlias Multiline Inherit (LPConstant 4) True) input' where expected = unlines [ "import Control.Applicative (Applicative (pure, (<*>)))" @@ -423,7 +420,7 @@ case17 = expected -------------------------------------------------------------------------------- case18 :: Assertion case18 = expected @=? testStep - (step 40 $ Align None AfterAlias InlineToMultiline Inherit (LPConstant 4) True) input' + (step 40 $ Options None AfterAlias InlineToMultiline Inherit (LPConstant 4) True) input' where expected = unlines ---------------------------------------- @@ -450,7 +447,7 @@ case18 = expected @=? testStep -------------------------------------------------------------------------------- case19 :: Assertion case19 = expected @=? testStep - (step 40 $ Align Global NewLine InlineWithBreak RightAfter (LPConstant 17) True) case19input + (step 40 $ Options Global NewLine InlineWithBreak RightAfter (LPConstant 17) True) case19input where expected = unlines ---------------------------------------- @@ -465,7 +462,7 @@ case19 = expected @=? testStep case19b :: Assertion case19b = expected @=? testStep - (step 40 $ Align File NewLine InlineWithBreak RightAfter (LPConstant 17) True) case19input + (step 40 $ Options File NewLine InlineWithBreak RightAfter (LPConstant 17) True) case19input where expected = unlines ---------------------------------------- @@ -480,7 +477,7 @@ case19b = expected @=? testStep case19c :: Assertion case19c = expected @=? testStep - (step 40 $ Align File NewLine InlineWithBreak RightAfter LPModuleName True) case19input + (step 40 $ Options File NewLine InlineWithBreak RightAfter LPModuleName True) case19input where expected = unlines ---------------------------------------- @@ -495,7 +492,7 @@ case19c = expected @=? testStep case19d :: Assertion case19d = expected @=? testStep - (step 40 $ Align Global NewLine InlineWithBreak RightAfter LPModuleName True) case19input + (step 40 $ Options Global NewLine InlineWithBreak RightAfter LPModuleName True) case19input where expected = unlines ---------------------------------------- -- cgit v1.2.3