summaryrefslogtreecommitdiff
path: root/testsuite/tests/parser/should_run
diff options
context:
space:
mode:
authorMikhail Vorozhtsov <mikhail.vorozhtsov@gmail.com>2012-07-15 00:48:37 +0700
committerSimon Marlow <marlowsd@gmail.com>2012-07-16 11:13:33 +0100
commit5246de0c97b98474e5797e593ba56009ed00e53c (patch)
tree20fdf7db90a546ef6c6d0cb4608c1fd672ed8505 /testsuite/tests/parser/should_run
parentb72aa2c9086f39a3d75928da1b7b7e1332509f61 (diff)
downloadhaskell-5246de0c97b98474e5797e593ba56009ed00e53c.tar.gz
Added MultiWayIf tests.
Diffstat (limited to 'testsuite/tests/parser/should_run')
-rw-r--r--testsuite/tests/parser/should_run/ParserMultiWayIf.hs15
-rw-r--r--testsuite/tests/parser/should_run/ParserMultiWayIf.stdout1
-rw-r--r--testsuite/tests/parser/should_run/all.T1
3 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_run/ParserMultiWayIf.hs b/testsuite/tests/parser/should_run/ParserMultiWayIf.hs
new file mode 100644
index 0000000000..83bd2e94a7
--- /dev/null
+++ b/testsuite/tests/parser/should_run/ParserMultiWayIf.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE MultiWayIf #-}
+
+module Main where
+
+x = 10
+x1 = if | x < 10 -> "< 10" | otherwise -> ""
+x2 = if | x < 10 -> "< 10"
+ | otherwise -> ""
+x3 = if | x < 10 -> "< 10"
+ | otherwise -> ""
+x4 = if | True -> "yes"
+x5 = if | True -> if | False -> 1 | True -> 2
+
+main = print $ x5 == 2
+
diff --git a/testsuite/tests/parser/should_run/ParserMultiWayIf.stdout b/testsuite/tests/parser/should_run/ParserMultiWayIf.stdout
new file mode 100644
index 0000000000..0ca95142bb
--- /dev/null
+++ b/testsuite/tests/parser/should_run/ParserMultiWayIf.stdout
@@ -0,0 +1 @@
+True
diff --git a/testsuite/tests/parser/should_run/all.T b/testsuite/tests/parser/should_run/all.T
index 6bc63d8e80..03951a1edb 100644
--- a/testsuite/tests/parser/should_run/all.T
+++ b/testsuite/tests/parser/should_run/all.T
@@ -5,3 +5,4 @@ test('readRun004', normal, compile_and_run, ['-fobject-code'])
test('T1344', normal, compile_and_run, [''])
test('operator', normal, compile_and_run, [''])
test('operator2', normal, compile_and_run, [''])
+test('ParserMultiWayIf', if_compiler_lt('ghc', '7.5', skip), compile_and_run, [''])