Files
mercury/tests/hard_coded/string_append_ioi.m
2020-10-06 19:20:18 +11:00

35 lines
948 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module string_append_ioi.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
%---------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
:- implementation.
:- import_module list.
:- import_module string.
%---------------------------------------------------------------------------%
main(!IO) :-
( if
string.append("", A, "cat"),
string.append("c", B, "cat"),
string.append("ca", C, "cat"),
string.append("cat", D, "cat"),
not string.append("cat", _, "dogcat")
then
io.write([A, B, C, D], !IO),
io.nl(!IO)
else
io.write_string("tested failed\n", !IO)
).