summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-06-01 15:07:03 +0200
committerJasper Van der Jeugt <m@jaspervdj.be>2012-06-01 15:07:03 +0200
commitf53dcf0f60df80b5f5fa7071d1b5d6464055b503 (patch)
tree2208b71237988d0c0d39fe74e2607a9593fb0c67 /tests
parent73507718f63b7c7dbf04fde7595f6f3f7fdcabb7 (diff)
downloadstylish-haskell-f53dcf0f60df80b5f5fa7071d1b5d6464055b503.tar.gz
Remove redundant ViewPatterns
See #4
Diffstat (limited to 'tests')
-rw-r--r--tests/StylishHaskell/Stylish/LanguagePragmas/Tests.hs33
1 files changed, 32 insertions, 1 deletions
diff --git a/tests/StylishHaskell/Stylish/LanguagePragmas/Tests.hs b/tests/StylishHaskell/Stylish/LanguagePragmas/Tests.hs
index 80a50bc..c802f62 100644
--- a/tests/StylishHaskell/Stylish/LanguagePragmas/Tests.hs
+++ b/tests/StylishHaskell/Stylish/LanguagePragmas/Tests.hs
@@ -19,12 +19,14 @@ import StylishHaskell.Tests.Util
tests :: Test
tests = testGroup "StylishHaskell.Stylish.LanguagePragmas.Tests"
[ case01
+ , case02
+ , case03
]
--------------------------------------------------------------------------------
case01 :: Test
-case01 = testCase "case 01" $ expected @=? testStylish stylish input
+case01 = testCase "case 01" $ expected @=? testStylish (stylish False) input
where
input = unlines
[ "{-# LANGUAGE ViewPatterns #-}"
@@ -39,3 +41,32 @@ case01 = testCase "case 01" $ expected @=? testStylish stylish input
, "{-# LANGUAGE ViewPatterns #-}"
, "module Main where"
]
+
+
+--------------------------------------------------------------------------------
+case02 :: Test
+case02 = testCase "case 02" $ expected @=? testStylish (stylish True) input
+ where
+ input = unlines
+ [ "{-# LANGUAGE ViewPatterns #-}"
+ , "increment ((+ 1) -> x) = x"
+ ]
+
+ expected = unlines
+ [ "{-# LANGUAGE ViewPatterns #-}"
+ , "increment ((+ 1) -> x) = x"
+ ]
+
+
+--------------------------------------------------------------------------------
+case03 :: Test
+case03 = testCase "case 03" $ expected @=? testStylish (stylish True) input
+ where
+ input = unlines
+ [ "{-# LANGUAGE ViewPatterns #-}"
+ , "increment x = x + 1"
+ ]
+
+ expected = unlines
+ [ "increment x = x + 1"
+ ]