mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
60 lines
1.4 KiB
Mathematica
60 lines
1.4 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% A test to see whether backwards arithmetic works.
|
|
|
|
% Note that currently only + and - can be run backwards;
|
|
% running * or // backwards would lead to multiple answers,
|
|
% and so we don't support that.
|
|
|
|
:- module rev_arith.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
:- import_module int.
|
|
:- import_module std_util.
|
|
|
|
main -->
|
|
{
|
|
3 = 1 + A,
|
|
3 = B + 2,
|
|
C = 1 + 2,
|
|
% 10 = 2 * D,
|
|
% 10 = E * 5,
|
|
% F = 2 * 5,
|
|
20 = 30 - G,
|
|
20 = H - 10,
|
|
I = 30 - 10
|
|
% 15 = 90 // J,
|
|
% 15 = K // 6,
|
|
% L = 90 // 6
|
|
},
|
|
io__write_int(A),
|
|
io__write_string("\n"),
|
|
io__write_int(B),
|
|
io__write_string("\n"),
|
|
io__write_int(C),
|
|
io__write_string("\n"),
|
|
% io__write_int(D),
|
|
% io__write_string("\n"),
|
|
% io__write_int(E),
|
|
% io__write_string("\n"),
|
|
% io__write_int(F),
|
|
% io__write_string("\n"),
|
|
io__write_int(G),
|
|
io__write_string("\n"),
|
|
io__write_int(H),
|
|
io__write_string("\n"),
|
|
io__write_int(I),
|
|
io__write_string("\n").
|
|
% io__write_int(J),
|
|
% io__write_string("\n"),
|
|
% io__write_int(K),
|
|
% io__write_string("\n"),
|
|
% io__write_int(L),
|
|
% io__write_string("\n").
|