mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 11:23:46 +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.
45 lines
1.3 KiB
Mathematica
45 lines
1.3 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% A test using module qualification to resolve ambiguous overloading.
|
|
% The three versions of `format' should all produce different output,
|
|
% despite having the same name, and strang and strung both importing string.m
|
|
%
|
|
% The implementation predicates are mostly have the same names too,
|
|
% and a couple have different clauses.
|
|
|
|
:- module qual_adv_test.
|
|
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred qual_adv_test.main(io.state::di, io.state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module list.
|
|
:- import_module string.
|
|
:- import_module qual_strang.
|
|
:- import_module qual_strung.
|
|
|
|
main -->
|
|
{ String = "asdfjkfhaslks" },
|
|
{ FString = "iii %s.\n"},
|
|
{ string.format(FString, [s(String)], Out1) },
|
|
io.write_string(Out1),
|
|
{ qual_strang.format(FString, [s(String)], Out2) },
|
|
io.write_string(Out2),
|
|
{ qual_strung.format(FString, [s(String)], Out3) },
|
|
io.write_string(Out3),
|
|
{ Out4 = qual_strang.format_func(FString, [s(String)]) },
|
|
{ Out5 = qual_strung.format_func(FString, [s(String)]) },
|
|
(
|
|
{ Out4 = Out2 },
|
|
{ Out5 = Out3 }
|
|
->
|
|
io.write_string("ok\n")
|
|
;
|
|
io.write_string("failed\n")
|
|
).
|