diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2018-04-26 20:52:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-26 20:52:24 +0200 |
commit | 8447f67e7d16c0a8f84759c72833e14cab5611e7 (patch) | |
tree | 32f2e7aa97d98582ac3ec4602686e396f4933a8a /tests | |
parent | b9c11413b17b5169fc7749f234ffef8fdbdb31aa (diff) | |
download | stylish-haskell-8447f67e7d16c0a8f84759c72833e14cab5611e7.tar.gz |
Support alignment of cases with a single guard
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Language/Haskell/Stylish/Step/SimpleAlign/Tests.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/Language/Haskell/Stylish/Step/SimpleAlign/Tests.hs b/tests/Language/Haskell/Stylish/Step/SimpleAlign/Tests.hs index a57e6e9..b8afab4 100644 --- a/tests/Language/Haskell/Stylish/Step/SimpleAlign/Tests.hs +++ b/tests/Language/Haskell/Stylish/Step/SimpleAlign/Tests.hs @@ -25,6 +25,7 @@ tests = testGroup "Language.Haskell.Stylish.Step.SimpleAlign.Tests" , testCase "case 05" case05 , testCase "case 06" case06 , testCase "case 07" case07 + , testCase "case 08" case08 ] @@ -148,3 +149,20 @@ case07 = , " , barqux :: Int" , " }" ] + + +-------------------------------------------------------------------------------- +case08 :: Assertion +case08 = expected @=? testStep (step 80 defaultConfig) input + where + input = unlines + [ "canDrink mbAge = case mbAge of" + , " Just age | age > 18 -> True" + , " _ -> False" + ] + + expected = unlines + [ "canDrink mbAge = case mbAge of" + , " Just age | age > 18 -> True" + , " _ -> False" + ] |