summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorOndřej Janošík <j.ondra14@gmail.com>2015-09-21 01:12:29 +0200
committerOndřej Janošík <j.ondra14@gmail.com>2015-09-21 01:12:29 +0200
commit82ec3e1c458f01206c0230d4db1855c4fb6c64d8 (patch)
treefe13b64ab5ab40695df4ef86cb5dc19b486d46f5 /tests
parent1637b47a9c773b870ac39c773c72d9dd6e01412b (diff)
downloadstylish-haskell-82ec3e1c458f01206c0230d4db1855c4fb6c64d8.tar.gz
New import list option
new line-multiline: Import list will start on new line when it's short enough to fit to single line. Otherwise it'll be multiline.
Diffstat (limited to 'tests')
-rw-r--r--tests/Language/Haskell/Stylish/Step/Imports/Tests.hs31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
index 36e54d9..4ed0bd6 100644
--- a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
+++ b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
@@ -44,6 +44,7 @@ tests = testGroup "Language.Haskell.Stylish.Step.Imports.Tests"
, testCase "case 15" case15
, testCase "case 16" case16
, testCase "case 17" case17
+ , testCase "case 18" case18
]
@@ -346,6 +347,7 @@ case14 = expected
[ "import qualified Data.List as List (concat, map, null, reverse, tail, (++))"
]
+
--------------------------------------------------------------------------------
case15 :: Assertion
case15 = expected
@@ -395,6 +397,7 @@ case16 = expected
, "import Data.Foo (Foo (Foo,Bar), Goo(Goo))"
]
+
--------------------------------------------------------------------------------
case17 :: Assertion
case17 = expected
@@ -411,3 +414,31 @@ case17 = expected
, ""
, "import Data.Identity (Identity (runIdentity,Identity))"
]
+
+
+--------------------------------------------------------------------------------
+case18 :: Assertion
+case18 = expected @=? testStep
+ (step 40 $ Align None AfterAlias InlineToMultiline 4 True) input'
+ where
+ expected = unlines
+ ----------------------------------------
+ [ "import Data.Foo as Foo (Bar, Baz, Foo)"
+ , ""
+ , "import Data.Identity"
+ , " (Identity (Identity, runIdentity))"
+ , ""
+ , "import Data.Acid as Acid"
+ , " ( closeAcidState"
+ , " , createCheckpoint"
+ , " , openLocalStateFrom"
+ , " )"
+ ]
+
+ input' = unlines
+ [ "import Data.Foo as Foo (Bar, Baz, Foo)"
+ , ""
+ , "import Data.Identity (Identity (Identity, runIdentity))"
+ , ""
+ , "import Data.Acid as Acid (closeAcidState, createCheckpoint, openLocalStateFrom)"
+ ]