import std.array : Appender;
Appender!(char[]) sink;
sink.reserve(1024);
IRCClient client;
IRCServer server;
auto parser = IRCParser(client, server);
immutable event = parser.toIRCEvent(":zorael!~NaN@2001:41d0:2:80b4:: PRIVMSG #flerrp :kameloso: 8ball");
sink.formatEventAssertBlock(event);
assert(sink.data ==
`{
enum input = ":zorael!~NaN@2001:41d0:2:80b4:: PRIVMSG #flerrp :kameloso: 8ball";
immutable event = parser.toIRCEvent(input);
with (event)
{
assert((type == IRCEvent.Type.CHAN), Enum!(IRCEvent.Type).toString(type));
assert((sender.nickname == "zorael"), sender.nickname);
assert((sender.ident == "~NaN"), sender.ident);
assert((sender.address == "2001:41d0:2:80b4::"), sender.address);
assert((channel == "#flerrp"), channel);
assert((content == "kameloso: 8ball"), content);
}
}`, '\n' ~ sink.data);
Constructs assert statement blocks for each changed field of an IRCEvent.