2020-08-18 19:20:45 +00:00
|
|
|
#include "../include/uirc.h"
|
2020-09-01 09:49:37 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2020-08-18 19:20:45 +00:00
|
|
|
|
|
|
|
#define cmd "QUIT"
|
|
|
|
#define arg1 "arg1"
|
|
|
|
#define arg2 "arg2"
|
|
|
|
#define trailing "Finished!"
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char mesg[513] = cmd " " arg1 " " arg2 " :" trailing;
|
|
|
|
IRC_Message parseout;
|
|
|
|
int res = 0;
|
|
|
|
if ((res = Tok_mesg(mesg, &parseout)) <= 0) {
|
|
|
|
printf("String could not be tokenized. %i\n", res);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2020-10-02 12:40:15 +00:00
|
|
|
if (strcmp(parseout.args[0], arg1) != 0) {
|
2020-08-18 19:20:45 +00:00
|
|
|
printf("Arg1 didn't match, got \"%s\" instead of \"%s\"\n", parseout.args[0], arg1);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2020-10-02 12:40:15 +00:00
|
|
|
if (strcmp(parseout.args[1], arg2) != 0) {
|
2020-08-18 19:20:45 +00:00
|
|
|
printf("Arg2 didn't match, got \"%s\" instead of \"%s\"\n", parseout.args[1], arg2);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2020-10-02 12:40:15 +00:00
|
|
|
if (strcmp(parseout.args[2], trailing) != 0) {
|
2020-08-18 19:20:45 +00:00
|
|
|
printf("Trailing didn't match, got \"%s\" instead of \"%s\"\n", parseout.args[2], trailing);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
2020-10-02 12:40:15 +00:00
|
|
|
|