diff options
author | Cale Gibbard <cgibbard@gmail.com> | 2020-06-30 10:46:49 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-07 08:34:46 -0400 |
commit | fa9bb70a3fefef681cb0e80cc78977386c1dcf0a (patch) | |
tree | 09c9f9f42540f75b5098ed47a28a09bb07ee19a2 /testsuite/tests/deSugar/should_run | |
parent | 3907ee01e68b383fa30386d163decf203acedb19 (diff) | |
download | haskell-fa9bb70a3fefef681cb0e80cc78977386c1dcf0a.tar.gz |
Add some tests for fail messages in do-expressions and monad-comprehensions.
Diffstat (limited to 'testsuite/tests/deSugar/should_run')
5 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/DsDoExprFailMsg.hs b/testsuite/tests/deSugar/should_run/DsDoExprFailMsg.hs new file mode 100644 index 0000000000..126308b66d --- /dev/null +++ b/testsuite/tests/deSugar/should_run/DsDoExprFailMsg.hs @@ -0,0 +1,3 @@ +main = do + (x:xs) <- return [] + return () diff --git a/testsuite/tests/deSugar/should_run/DsDoExprFailMsg.stderr b/testsuite/tests/deSugar/should_run/DsDoExprFailMsg.stderr new file mode 100644 index 0000000000..6a0c0b97dc --- /dev/null +++ b/testsuite/tests/deSugar/should_run/DsDoExprFailMsg.stderr @@ -0,0 +1 @@ +DsDoExprFailMsg: user error (Pattern match failure in 'do' block at DsDoExprFailMsg.hs:2:3-8) diff --git a/testsuite/tests/deSugar/should_run/DsMonadCompFailMsg.hs b/testsuite/tests/deSugar/should_run/DsMonadCompFailMsg.hs new file mode 100644 index 0000000000..869c475e8e --- /dev/null +++ b/testsuite/tests/deSugar/should_run/DsMonadCompFailMsg.hs @@ -0,0 +1,2 @@ +{-# LANGUAGE MonadComprehensions #-} +main = [() | (x:xs) <- return []] diff --git a/testsuite/tests/deSugar/should_run/DsMonadCompFailMsg.stderr b/testsuite/tests/deSugar/should_run/DsMonadCompFailMsg.stderr new file mode 100644 index 0000000000..d5b72f848c --- /dev/null +++ b/testsuite/tests/deSugar/should_run/DsMonadCompFailMsg.stderr @@ -0,0 +1 @@ +DsMonadCompFailMsg: user error (Pattern match failure in monad comprehension at DsMonadCompFailMsg.hs:2:14-19) diff --git a/testsuite/tests/deSugar/should_run/all.T b/testsuite/tests/deSugar/should_run/all.T index 6245f9caf5..2df9586b7d 100644 --- a/testsuite/tests/deSugar/should_run/all.T +++ b/testsuite/tests/deSugar/should_run/all.T @@ -66,3 +66,6 @@ test('T12595', normal, compile_and_run, ['']) test('T13285', normal, compile_and_run, ['']) test('T18151', normal, compile_and_run, ['']) test('T18172', [], ghci_script, ['T18172.script']) + +test('DsDoExprFailMsg', exit_code(1), compile_and_run, ['']) +test('DsMonadCompFailMsg', exit_code(1), compile_and_run, ['']) |