mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 05:13:48 +00:00
Estimated hours taken: tests/debugger/exception_cmd.*: New test case to test the "exception" command. tests/debugger/exception_vars.*: Put this test case back the way it was. Mmakefile: Enable the new test case.
22 lines
305 B
Mathematica
22 lines
305 B
Mathematica
:- module exception_cmd.
|
|
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module require, int.
|
|
|
|
main --> { test(42, X) }, print(X).
|
|
|
|
:- pred test(int::in, int::out) is det.
|
|
|
|
test(X, Y) :-
|
|
( X > 0 ->
|
|
error("oops")
|
|
;
|
|
Y = X + 1
|
|
).
|