Files
mercury/tests/string_format/string_format_o.m
Julien Fischer b09f407a1f Update programming style in string format tests.
Document reasons for multiple expected outputs.

tests/string_format/*.m:
     As above.
2020-05-23 15:03:42 +10:00

33 lines
923 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% Test the o specifier of string.format with ints.
%
% The .exp file is for when int is 32-bit.
% The .exp2 file is for when int is 64-bit.
%
%---------------------------------------------------------------------------%
:- module string_format_o.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
%---------------------------------------------------------------------------%
:- implementation.
:- import_module int.
:- import_module list.
:- import_module string.
:- import_module string_format_lib.
main(!IO) :-
Ints = [i(0), i(1), i(10), i(100), i(max_int)],
list.foldl(output_list(Ints), format_strings("o"), !IO).
%---------------------------------------------------------------------------%