Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
bf178098
Commit
bf178098
authored
Nov 21, 2002
by
simonpj
Browse files
[project @ 2002-11-21 09:25:27 by simonpj]
Add test for pattern-match failure in do-notation
parent
686d64b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/deSugar/should_run/all.T
View file @
bf178098
...
...
@@ -12,3 +12,4 @@ test('dsrun006', normal, compile_and_run, [''])
test
('
dsrun007
',
exit_code
(
1
),
compile_and_run
,
[''])
test
('
dsrun008
',
exit_code
(
1
),
compile_and_run
,
[''])
test
('
dsrun009
',
normal
,
compile_and_run
,
[''])
test
('
dsrun010
',
normal
,
compile_and_run
,
[''])
testsuite/tests/ghc-regress/deSugar/should_run/dsrun010.hs
0 → 100644
View file @
bf178098
-- Check that pattern match failure in do-notation
-- is reflected by calling the monadic 'fail', not by a
-- runtime exception
import
Maybe
import
Control.Monad
test
::
(
MonadPlus
m
)
=>
[
a
]
->
m
Bool
test
xs
=
do
(
_
:
_
)
<-
return
xs
-- Should fail here
return
True
`
mplus
`
-- Failure in LH arg should trigger RH arg
do
return
False
main
::
IO
()
main
=
do
let
x
=
fromJust
(
test
[]
)
putStrLn
(
show
x
)
testsuite/tests/ghc-regress/deSugar/should_run/dsrun010.stdout
0 → 100644
View file @
bf178098
False
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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