summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorOndřej Janošík <j.ondra14@gmail.com>2015-07-09 15:06:32 +0200
committerOndřej Janošík <j.ondra14@gmail.com>2015-07-09 15:06:32 +0200
commit184591eda03be2de00613d1ddcc9234f2da95562 (patch)
tree3427691550cfda01267ad432587022e2ffd4c65f /tests
parent729c0cf4d315133e92b4e5c5b92bdc5f2fab7ef8 (diff)
downloadstylish-haskell-184591eda03be2de00613d1ddcc9234f2da95562.tar.gz
Added option to break line with inline style only when import is too long
Diffstat (limited to 'tests')
-rw-r--r--tests/Language/Haskell/Stylish/Step/Imports/Tests.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
index 2b35f5a..2062fe0 100644
--- a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
+++ b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
@@ -39,6 +39,8 @@ tests = testGroup "Language.Haskell.Stylish.Step.Imports.Tests"
, testCase "case 10" case10
, testCase "case 11" case11
, testCase "case 12" case12
+ , testCase "case 13" case13
+ , testCase "case 14" case14
]
@@ -307,3 +309,30 @@ case12 = expected @=? testStep (step 80 $ Align Group NewLine Inline 2) input'
[ "import Data.List"
, " (map)"
]
+
+
+--------------------------------------------------------------------------------
+case13 :: Assertion
+case13 = expected
+ @=? testStep (step 80 $ Align None WithAlias InlineWithBreak 4) input'
+ where
+ input' = unlines
+ [ "import qualified Data.List as List (concat, foldl, foldr, head, init,"
+ , " last, length, map, null, reverse, tail, (++))"
+ ]
+
+ expected = unlines
+ [ "import qualified Data.List as List"
+ , " (concat, foldl, foldr, head, init, last, length, map, null, reverse, tail,"
+ , " (++))"
+ ]
+
+
+--------------------------------------------------------------------------------
+case14 :: Assertion
+case14 = expected
+ @=? testStep (step 80 $ Align None WithAlias InlineWithBreak 10) expected
+ where
+ expected = unlines
+ [ "import qualified Data.List as List (concat, map, null, reverse, tail, (++))"
+ ]