summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorArtyom Kazak <yom@artyom.me>2017-04-22 16:14:52 +0300
committerJasper Van der Jeugt <jaspervdj@gmail.com>2017-04-22 15:14:52 +0200
commitd10ebd066bfb93ae8e0a155c45da3c574a431911 (patch)
treec90d94d24c647b0397f6f0e9d80444d44092e873 /tests
parent842bd709e9c3b76c2ab25b4d24a356036a8ba22e (diff)
downloadstylish-haskell-d10ebd066bfb93ae8e0a155c45da3c574a431911.tar.gz
Deduplicate import specs (#165)
Fixes #163
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 c3178ac..e1a7462 100644
--- a/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
+++ b/tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
@@ -47,6 +47,7 @@ tests = testGroup "Language.Haskell.Stylish.Step.Imports.Tests"
, testCase "case 19d" case19c
, testCase "case 19d" case19d
, testCase "case 20" case20
+ , testCase "case 21" case21
]
@@ -531,3 +532,33 @@ case20 = expected
, "import qualified Data.Map as Map"
, "import Data.Set (empty)"
]
+
+--------------------------------------------------------------------------------
+case21 :: Assertion
+case21 = expected
+ @=? testStep (step 80 defaultOptions) input'
+ where
+ expected = unlines
+ [ "{-# LANGUAGE ExplicitNamespaces #-}"
+ , "import X1 (A, B, C)"
+ , "import X2 (A, B, C)"
+ , "import X3 (A (..))"
+ , "import X4 (A (..))"
+ , "import X5 (A (..))"
+ , "import X6 (A (a, b, c), B (m, n, o))"
+ , "import X7 (a, b, c)"
+ , "import X8 (type (+), (+))"
+ , "import X9 hiding (x, y, z)"
+ ]
+ input' = unlines
+ [ "{-# LANGUAGE ExplicitNamespaces #-}"
+ , "import X1 (A, B, A, C, A, B, A)"
+ , "import X2 (C(), B(), A())"
+ , "import X3 (A(..))"
+ , "import X4 (A, A(..))"
+ , "import X5 (A(..), A(x))"
+ , "import X6 (A(a,b), B(m,n), A(c), B(o))"
+ , "import X7 (a, b, a, c)"
+ , "import X8 (type (+), (+))"
+ , "import X9 hiding (x, y, z, x)"
+ ]