Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
3798b2aa
Commit
3798b2aa
authored
Jan 26, 2016
by
Simon Peyton Jones
Browse files
Fix three broken tests involving exceptions
See comment:16 in Trac
#10712
. The tests were wrong, not GHC!
parent
f1885dfd
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/concurrent/should_run/T3279.hs
View file @
3798b2aa
...
...
@@ -7,7 +7,7 @@ import GHC.IO (unsafeUnmask)
f
::
Int
f
=
(
1
+
)
.
unsafePerformIO
$
do
error
"foo"
`
catch
`
\
(
SomeException
e
)
->
do
throwIO
(
ErrorCall
"foo"
)
`
catch
`
\
(
SomeException
e
)
->
do
myThreadId
>>=
flip
throwTo
e
-- point X
unsafeUnmask
$
return
1
...
...
@@ -22,4 +22,4 @@ main = do
yield
-- should print 1 + 1 = 2
print
f
testsuite/tests/concurrent/should_run/conc012.hs
View file @
3798b2aa
...
...
@@ -14,8 +14,8 @@ stackoverflow n = n + stackoverflow n
main
=
do
let
x
=
stackoverflow
1
result
<-
newEmptyMVar
forkIO
$
Control
.
Exception
.
catch
(
x
`
seq
`
putMVar
result
Finished
)
$
result
<-
newEmptyMVar
forkIO
$
Control
.
Exception
.
catch
(
evaluate
x
>>
putMVar
result
Finished
)
$
\
e
->
putMVar
result
(
Died
e
)
res
<-
takeMVar
result
case
res
of
...
...
testsuite/tests/concurrent/should_run/conc014.hs
View file @
3798b2aa
...
...
@@ -8,14 +8,12 @@ main = do
main_thread
<-
myThreadId
m
<-
newEmptyMVar
forkIO
(
do
{
takeMVar
m
;
throwTo
main_thread
(
ErrorCall
"foo"
)
})
(
do
error
"wibble"
`
Control
.
Exception
.
catch
`
(
do
{
throwIO
(
ErrorCall
"wibble"
)
`
Control
.
Exception
.
catch
`
(
\
e
->
let
_
=
e
::
ErrorCall
in
do
putMVar
m
()
;
sum
[
1
..
10000
]
`
seq
`
putStrLn
"done."
)
myDelay
500000
)
`
Control
.
Exception
.
catch
`
do
putMVar
m
()
;
evaluate
(
sum
[
1
..
10000
]);
putStrLn
"done."
)
;
myDelay
500000
})
`
Control
.
Exception
.
catch
`
\
e
->
putStrLn
(
"caught: "
++
show
(
e
::
SomeException
))
-- compensate for the fact that threadDelay is non-interruptible
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment