summaryrefslogtreecommitdiffhomepage
path: root/tests/Language/Haskell/Stylish/Step/Squash/Tests.hs
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-01-17 11:15:37 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-01-17 11:15:37 -0700
commit3130faccf7c9a9a7697e246884e2b60fd4b1f9de (patch)
treeab171724845fe928ef05692c27351be933228ec2 /tests/Language/Haskell/Stylish/Step/Squash/Tests.hs
parentfd8bfa2853825504c2dbc7678154ac8d56d47035 (diff)
parent84770e33bb6286c163c3b2b10fa98d264f6672b8 (diff)
downloadstylish-haskell-3130faccf7c9a9a7697e246884e2b60fd4b1f9de.tar.gz
Merge tag 'v0.12.2.0'
v0.12.2.0 - 0.12.2.0 (2020-10-08) * align: Add a new option for aligning only adjacent items (by 1Computer1) * align: Add support for aligning MultiWayIf syntax (by 1Computer1) * data: Fix some issues with record field padding * module_header: Add separate_lists option * imports: Respect separate_lists for (..) imports * data: Make sorting deriving list optional (by Maxim Koltsov)
Diffstat (limited to 'tests/Language/Haskell/Stylish/Step/Squash/Tests.hs')
-rw-r--r--tests/Language/Haskell/Stylish/Step/Squash/Tests.hs137
1 files changed, 59 insertions, 78 deletions
diff --git a/tests/Language/Haskell/Stylish/Step/Squash/Tests.hs b/tests/Language/Haskell/Stylish/Step/Squash/Tests.hs
index a785d9a..9139507 100644
--- a/tests/Language/Haskell/Stylish/Step/Squash/Tests.hs
+++ b/tests/Language/Haskell/Stylish/Step/Squash/Tests.hs
@@ -1,13 +1,14 @@
--------------------------------------------------------------------------------
+{-# LANGUAGE OverloadedLists #-}
module Language.Haskell.Stylish.Step.Squash.Tests
( tests
) where
--------------------------------------------------------------------------------
-import Test.Framework (Test, testGroup)
-import Test.Framework.Providers.HUnit (testCase)
-import Test.HUnit (Assertion, (@=?))
+import Test.Framework (Test, testGroup)
+import Test.Framework.Providers.HUnit (testCase)
+import Test.HUnit (Assertion)
--------------------------------------------------------------------------------
@@ -28,94 +29,74 @@ tests = testGroup "Language.Haskell.Stylish.Step.SimpleSquash.Tests"
--------------------------------------------------------------------------------
case01 :: Assertion
-case01 = expected @=? testStep step input
- where
- input = unlines
- [ "data Foo = Foo"
- , " { foo :: Int"
- , " , barqux :: String"
- , " } deriving (Show)"
- ]
-
- expected = unlines
- [ "data Foo = Foo"
- , " { foo :: Int"
- , " , barqux :: String"
- , " } deriving (Show)"
- ]
+case01 = assertSnippet step
+ [ "data Foo = Foo"
+ , " { foo :: Int"
+ , " , barqux :: String"
+ , " } deriving (Show)"
+ ]
+ [ "data Foo = Foo"
+ , " { foo :: Int"
+ , " , barqux :: String"
+ , " } deriving (Show)"
+ ]
--------------------------------------------------------------------------------
case02 :: Assertion
-case02 = expected @=? testStep step input
- where
- input = unlines
- [ "data Foo = Foo"
- , " { fooqux"
- , " , bar :: String"
- , " } deriving (Show)"
- ]
-
- expected = unlines
- [ "data Foo = Foo"
- , " { fooqux"
- , " , bar :: String"
- , " } deriving (Show)"
- ]
+case02 = assertSnippet step
+ [ "data Foo = Foo"
+ , " { fooqux"
+ , " , bar :: String"
+ , " } deriving (Show)"
+ ]
+ [ "data Foo = Foo"
+ , " { fooqux"
+ , " , bar :: String"
+ , " } deriving (Show)"
+ ]
--------------------------------------------------------------------------------
case03 :: Assertion
-case03 = expected @=? testStep step input
- where
- input = unlines
- [ "maybe y0 f mx ="
- , " case mx of"
- , " Nothing -> y0"
- , " Just x -> f x"
- ]
-
- expected = unlines
- [ "maybe y0 f mx ="
- , " case mx of"
- , " Nothing -> y0"
- , " Just x -> f x"
- ]
+case03 = assertSnippet step
+ [ "maybe y0 f mx ="
+ , " case mx of"
+ , " Nothing -> y0"
+ , " Just x -> f x"
+ ]
+ [ "maybe y0 f mx ="
+ , " case mx of"
+ , " Nothing -> y0"
+ , " Just x -> f x"
+ ]
--------------------------------------------------------------------------------
case04 :: Assertion
-case04 = expected @=? testStep step input
- where
- input = unlines
- [ "maybe y0 f mx ="
- , " case mx of"
- , " Nothing ->"
- , " y0"
- , " Just x ->"
- , " f x"
- ]
-
- expected = unlines
- [ "maybe y0 f mx ="
- , " case mx of"
- , " Nothing ->"
- , " y0"
- , " Just x ->"
- , " f x"
- ]
+case04 = assertSnippet step
+ [ "maybe y0 f mx ="
+ , " case mx of"
+ , " Nothing ->"
+ , " y0"
+ , " Just x ->"
+ , " f x"
+ ]
+ [ "maybe y0 f mx ="
+ , " case mx of"
+ , " Nothing ->"
+ , " y0"
+ , " Just x ->"
+ , " f x"
+ ]
--------------------------------------------------------------------------------
case05 :: Assertion
-case05 = expected @=? testStep step input
- where
- input = unlines
- [ "maybe y0 _ Nothing = y"
- , "maybe _ f (Just x) = f x"
- ]
-
- expected = unlines
- [ "maybe y0 _ Nothing = y"
- , "maybe _ f (Just x) = f x"
- ]
+case05 = assertSnippet step
+ [ "maybe y0 _ Nothing = y"
+ , "maybe _ f (Just x) = f x"
+ ]
+ [ "maybe y0 _ Nothing = y"
+ , "maybe _ f (Just x) = f x"
+ ]