diff options
author | Ondřej Janošík <j.ondra14@gmail.com> | 2015-07-10 23:55:58 +0200 |
---|---|---|
committer | Ondřej Janošík <j.ondra14@gmail.com> | 2015-07-10 23:55:58 +0200 |
commit | 86b93e4abf7976b73fcf7ba9988283415e6f5d41 (patch) | |
tree | 1aa2897f0fc538dc2276e1728f8da5d500f22691 /tests | |
parent | 435af629f2808c5c167b4a02ac8987ed5a8457bf (diff) | |
download | stylish-haskell-86b93e4abf7976b73fcf7ba9988283415e6f5d41.tar.gz |
Fixed invalid padding
Import alias is no longer padded when align is set to 'none'
and long_list_align is set to 'new line' or 'multiline'.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Language/Haskell/Stylish/Step/Imports/Tests.hs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs index 2062fe0..95f003e 100644 --- a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs +++ b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs @@ -41,6 +41,7 @@ tests = testGroup "Language.Haskell.Stylish.Step.Imports.Tests" , testCase "case 12" case12 , testCase "case 13" case13 , testCase "case 14" case14 + , testCase "case 15" case15 ] @@ -336,3 +337,28 @@ case14 = expected expected = unlines [ "import qualified Data.List as List (concat, map, null, reverse, tail, (++))" ] + +-------------------------------------------------------------------------------- +case15 :: Assertion +case15 = expected + @=? testStep (step 80 $ Align None AfterAlias Multiline 4) input' + where + expected = unlines + [ "import Data.Acid (AcidState)" + , "import qualified Data.Acid as Acid" + , " ( closeAcidState" + , " , createCheckpoint" + , " , openLocalStateFrom" + , " )" + , "import Data.Default.Class (Default (def))" + , "" + , "import qualified Herp.Derp.Internal.Types.Foobar as Internal (bar, foo)" + ] + + input' = unlines + [ "import Data.Acid (AcidState)" + , "import qualified Data.Acid as Acid (closeAcidState, createCheckpoint, openLocalStateFrom)" + , "import Data.Default.Class (Default (def))" + , "" + , "import qualified Herp.Derp.Internal.Types.Foobar as Internal (foo, bar)" + ] |