mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 10:53:40 +00:00
tests/declarative_debugger/*.m:
tests/exceptions/*.m:
tests/general/*.m:
tests/grade_subdirs/*.m:
tests/purity/*.m:
tests/submodules/*.m:
tests/typeclasses/*.m:
Update programming style.
tests/declarative_debugger/*.inp:
Update line numbers in breakpoint commands.
tests/declarative_debugger/*.exp:
Update expected line numbers.
tests/exceptions/Mercury.options:
tests/general/Mercury.options:
Disable some warnings that are irrelevant to the test.
47 lines
789 B
Mathematica
47 lines
789 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module double_error.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module list.
|
|
:- import_module require.
|
|
|
|
main(!IO) :-
|
|
io.command_line_arguments(Args, !IO),
|
|
list.length(Args, Num),
|
|
( if p(Num) then
|
|
io.write_string("1\n", !IO)
|
|
else
|
|
Arg = "not 1\n",
|
|
error(Arg)
|
|
),
|
|
( if q(Num) then
|
|
io.write_string("2\n", !IO)
|
|
else
|
|
Arg = "not 2\n",
|
|
error(Arg)
|
|
).
|
|
|
|
:- pred p(int::in) is semidet.
|
|
|
|
p(0).
|
|
p(1).
|
|
p(2).
|
|
p(3).
|
|
|
|
:- pred q(int::in) is semidet.
|
|
|
|
q(0).
|
|
q(4).
|
|
q(5).
|
|
q(6).
|