diff options
author | Maxim Koltsov <kolmax94@gmail.com> | 2020-10-05 21:28:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-05 20:28:37 +0200 |
commit | 84ff4e57eb24b5b5ab95ad7b64419846922e00f7 (patch) | |
tree | ea99f73bb9e6288670b16416cf0ad461bafedd1a /tests | |
parent | 062310c5d3420e58edea1a2d6bbe0f71d18a184e (diff) | |
download | stylish-haskell-84ff4e57eb24b5b5ab95ad7b64419846922e00f7.tar.gz |
Make sorting deriving list optional (#316)
* Make sorting deriving list optional
Not everyone wants their typeclasses sorted.
* Remove redundant code
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Language/Haskell/Stylish/Step/Data/Tests.hs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/Language/Haskell/Stylish/Step/Data/Tests.hs b/tests/Language/Haskell/Stylish/Step/Data/Tests.hs index 4357af6..9ed9d0d 100644 --- a/tests/Language/Haskell/Stylish/Step/Data/Tests.hs +++ b/tests/Language/Haskell/Stylish/Step/Data/Tests.hs @@ -65,6 +65,7 @@ tests = testGroup "Language.Haskell.Stylish.Step.Data.Tests" , testCase "case 52" case52 , testCase "case 53" case53 , testCase "case 54" case54 + , testCase "case 55" case55 ] case00 :: Assertion @@ -1200,17 +1201,29 @@ case54 = expected @=? testStep (step indentIndentStyle { cMaxColumns = MaxColumn , " deriving newtype (Applicative, Functor, Monad)" ] +case55 :: Assertion +case55 = expected @=? testStep (step sameSameNoSortStyle) input + where + input = unlines + [ "data Foo = Foo deriving (Z, Y, X, Bar, Abcd)" + ] + + expected = input + sameSameStyle :: Config -sameSameStyle = Config SameLine SameLine 2 2 False True SameLine False NoMaxColumns +sameSameStyle = Config SameLine SameLine 2 2 False True SameLine False True NoMaxColumns sameIndentStyle :: Config -sameIndentStyle = Config SameLine (Indent 2) 2 2 False True SameLine False NoMaxColumns +sameIndentStyle = Config SameLine (Indent 2) 2 2 False True SameLine False True NoMaxColumns indentSameStyle :: Config -indentSameStyle = Config (Indent 2) SameLine 2 2 False True SameLine False NoMaxColumns +indentSameStyle = Config (Indent 2) SameLine 2 2 False True SameLine False True NoMaxColumns indentIndentStyle :: Config -indentIndentStyle = Config (Indent 2) (Indent 2) 2 2 False True SameLine False NoMaxColumns +indentIndentStyle = Config (Indent 2) (Indent 2) 2 2 False True SameLine False True NoMaxColumns indentIndentStyle4 :: Config -indentIndentStyle4 = Config (Indent 4) (Indent 4) 4 4 False True SameLine False NoMaxColumns +indentIndentStyle4 = Config (Indent 4) (Indent 4) 4 4 False True SameLine False True NoMaxColumns + +sameSameNoSortStyle :: Config +sameSameNoSortStyle = Config SameLine SameLine 2 2 False True SameLine False False NoMaxColumns |