mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
32 lines
879 B
Mathematica
32 lines
879 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module string_append_iii.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
:- import_module string.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
|
|
main(!IO) :-
|
|
( if
|
|
string.append("", "cat", "cat"),
|
|
string.append("c", "at", "cat"),
|
|
string.append("ca", "t", "cat"),
|
|
string.append("cat", "", "cat")
|
|
then
|
|
io.write_string("test succeeded\n", !IO)
|
|
else
|
|
io.write_string("test failed\n", !IO)
|
|
).
|