#include "../include/uirc.h" #include #include #include int main(void) { char mesg[513] = {0}; IRC_Message input = { #ifdef UIRC_IRCV3 .tags = {.msgid = {.value = "10"}}, #endif .name = {.nick = "dad", .user = "dad-door", .host = "home.localhost"}, .cmd = PRIVMSG, .args = {"(You)", "are ya winning son?", NULL}, .trailing = true, }; signed long res; if ((res = Assm_mesg(mesg, &input, 512)) <= 0) { printf("Failed to assemble message. (%li)\n", res); return EXIT_FAILURE; } char* expect = #ifdef UIRC_IRCV3 "@msgid=10 " #endif ":dad!dad-door@home.localhost PRIVMSG (You) :are ya winning son?\r\n"; if (strcmp(expect, mesg) != 0) { printf("Assembled message mismatch.\nGot:\n%s\nbut expected:\n%s\n", mesg, expect); return EXIT_FAILURE; } return EXIT_SUCCESS; }