summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-14 08:57:06 +0100
committerAndreas Klebinger <klebinger.andreas@gmx.at>2021-11-09 15:21:14 +0000
commit8acdfdfb5c7442e0445ad9e767927c5661ce8d04 (patch)
treee7194f283eb2d2e9ad81b3a9d14084f81d3654eb
parent79a26df1475505ee1e87eb7fda04e5fefdf6aa4c (diff)
downloadhaskell-wip/test-t19841.tar.gz
Add test for #19841wip/test-t19841
-rw-r--r--testsuite/tests/stranal/should_run/T19841.hs14
-rw-r--r--testsuite/tests/stranal/should_run/T19841.stderr2
-rw-r--r--testsuite/tests/stranal/should_run/all.T1
3 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_run/T19841.hs b/testsuite/tests/stranal/should_run/T19841.hs
new file mode 100644
index 0000000000..ff05c19297
--- /dev/null
+++ b/testsuite/tests/stranal/should_run/T19841.hs
@@ -0,0 +1,14 @@
+module Main where
+
+import Control.Exception
+import Debug.Trace
+import System.IO
+
+data MyException = MyException deriving Show
+instance Exception MyException
+
+main :: IO ()
+main = handle (\ MyException -> hPutStrLn stderr "Exception") $ do
+ trace "Debugging" 5
+ `seq` throw MyException
+ `seq` hPutStrLn stderr "Survived Exception"
diff --git a/testsuite/tests/stranal/should_run/T19841.stderr b/testsuite/tests/stranal/should_run/T19841.stderr
new file mode 100644
index 0000000000..d5f1763b70
--- /dev/null
+++ b/testsuite/tests/stranal/should_run/T19841.stderr
@@ -0,0 +1,2 @@
+Debugging
+Exception
diff --git a/testsuite/tests/stranal/should_run/all.T b/testsuite/tests/stranal/should_run/all.T
index e28b0ef7ee..47a4af4e5a 100644
--- a/testsuite/tests/stranal/should_run/all.T
+++ b/testsuite/tests/stranal/should_run/all.T
@@ -27,3 +27,4 @@ test('T14290', normal, compile_and_run, [''])
test('T14285', normal, multimod_compile_and_run, ['T14285', ''])
test('T17676', normal, compile_and_run, [''])
test('T19053', normal, compile_and_run, [''])
+test('T19841', normal, compile_and_run, [''])