mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 16:24:43 +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.4 KiB
Mathematica
45 lines
1.4 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% This is a test to check the correctness of the string__join_list predicate.
|
|
|
|
:- module join_list.
|
|
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
:- import_module list.
|
|
:- import_module string.
|
|
|
|
main -->
|
|
test_join_list([]),
|
|
test_join_list(["a", "b"]),
|
|
test_join_list(["a", "b", "c"]),
|
|
test_join_list(["a", "", "c"]),
|
|
test_join_list(["abc", "def", "ghi"]),
|
|
test_join_list(["the", "quick", "brown", "fox", "jumped", "over",
|
|
"the", "lazy", "dog"]),
|
|
test_join_list(["this", "is", "a", "test", "to", "check",
|
|
"the correctness", " of the", "join_list ", "predicate\n"]),
|
|
test_join_list([" ", "\t", " \t ", "x"]).
|
|
|
|
:- pred test_join_list(list(string)::in, io__state::di, io__state::uo) is det.
|
|
|
|
test_join_list(Pieces) -->
|
|
{ Joined1 = string__join_list(", ", Pieces) },
|
|
io__write_string(Joined1),
|
|
io__write_string("\n"),
|
|
{ Joined2 = string__join_list(" ", Pieces) },
|
|
io__write_string(Joined2),
|
|
io__write_string("\n"),
|
|
{ Joined3 = string__join_list(" x ", Pieces) },
|
|
io__write_string(Joined3),
|
|
io__write_string("\n"),
|
|
{ Joined4 = string__join_list("", Pieces) },
|
|
io__write_string(Joined4),
|
|
io__write_string("\n").
|