diff options
author | Eric Seidel <gridaphobe@gmail.com> | 2015-09-21 19:18:56 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-09-21 19:24:47 -0500 |
commit | 0b852fcf74c65291aeb6357973ecb715735d6383 (patch) | |
tree | d92dddac04d543cb5811a4f689649ef846375f15 /libraries/base/tests | |
parent | 83e23c1a4cce36de68c3c8323d27f24182b33f34 (diff) | |
download | haskell-0b852fcf74c65291aeb6357973ecb715735d6383.tar.gz |
base: use Show for ErrorCall in uncaughtExceptionHandler
The default top-level exception handler now uses the `Show` instance for
`ErrorCall` when printing exceptions, so it will actually print the out-of-band
data (e.g. `CallStack`s) in compiled binaries, instead of just printing the
error message.
This also updates the hpc submodule to fix the test output.
Reviewed By: austin, thomie
Differential Revision: https://phabricator.haskell.org/D1217
Diffstat (limited to 'libraries/base/tests')
-rw-r--r-- | libraries/base/tests/all.T | 4 | ||||
-rw-r--r-- | libraries/base/tests/readFloat.stderr | 2 | ||||
-rw-r--r-- | libraries/base/tests/topHandler04.hs | 5 | ||||
-rw-r--r-- | libraries/base/tests/topHandler04.stderr | 2 |
4 files changed, 13 insertions, 0 deletions
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 96cb551a26..f53ad0cb80 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -162,6 +162,10 @@ test('topHandler03', ignore_output, signal_exit_code(15) ], compile_and_run, ['']) +test('topHandler04', + [when(opsys('mingw32'), skip), + exit_code(1) + ], compile_and_run, ['']) test('T8766', diff --git a/libraries/base/tests/readFloat.stderr b/libraries/base/tests/readFloat.stderr index 929906187e..99049a35b7 100644 --- a/libraries/base/tests/readFloat.stderr +++ b/libraries/base/tests/readFloat.stderr @@ -1 +1,3 @@ readFloat: Prelude.read: no parse +CallStack: + error, called at libraries/base/Text/Read.hs:90:17 in base:Text.Read diff --git a/libraries/base/tests/topHandler04.hs b/libraries/base/tests/topHandler04.hs new file mode 100644 index 0000000000..ae669a07b4 --- /dev/null +++ b/libraries/base/tests/topHandler04.hs @@ -0,0 +1,5 @@ +import Control.Exception + +-- test that the out-of-band data in an ErrorCall exception is printed + +main = throw (ErrorCallWithLocation "error" "out-of-band") diff --git a/libraries/base/tests/topHandler04.stderr b/libraries/base/tests/topHandler04.stderr new file mode 100644 index 0000000000..e9bba9e480 --- /dev/null +++ b/libraries/base/tests/topHandler04.stderr @@ -0,0 +1,2 @@ +topHandler04: error +out-of-band |