summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorMikhail Glushenkov <the.dead.shall.rise@gmail.com>2012-11-04 00:51:49 +0100
committerMikhail Glushenkov <the.dead.shall.rise@gmail.com>2012-11-05 10:53:04 +0100
commit04982b5bba719d84fdd8dd567af5493abf0dbd60 (patch)
tree02a2aafbe8454dbc5bac6c8286ec78828d6946c4 /tests
parent7c96e69a4494aa0a1c41b1dcb5f65ff19bff64b6 (diff)
downloadstylish-haskell-04982b5bba719d84fdd8dd567af5493abf0dbd60.tar.gz
Add a new import alignment mode 'file'.
This mode is like 'global', but doesn't add paddding for non-existent qualified imports. For example, with 'global' import A import B is always transformed to import A import B even if there are no qualified imports in the whole file.
Diffstat (limited to 'tests')
-rw-r--r--tests/Language/Haskell/Stylish/Step/Imports/Tests.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
index 78083f9..d3b205a 100644
--- a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
+++ b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
@@ -23,6 +23,7 @@ tests = testGroup "Language.Haskell.Stylish.Step.Imports.Tests"
, testCase "case 03" case03
, testCase "case 04" case04
, testCase "case 05" case05
+ , testCase "case 06" case06
]
@@ -121,3 +122,16 @@ case05 = input' @=? testStep (step 80 Group) input'
where
input' = "import Distribution.PackageDescription.Configuration " ++
"(finalizePackageDescription)\n"
+
+--------------------------------------------------------------------------------
+case06 :: Assertion
+case06 = expected @=? testStep (step 80 File) input'
+ where
+ input' =
+ "import Data.Aeson.Types (object, typeMismatch, FromJSON(..)," ++
+ "ToJSON(..), Value(..), parseEither, (.!=), (.:), (.:?), (.=))"
+
+ expected = unlines
+ [ "import Data.Aeson.Types (FromJSON (..), ToJSON (..), Value (..), object,"
+ , " parseEither, typeMismatch, (.!=), (.:), (.:?), (.=))"
+ ]