diff --git a/expecttest.c b/expecttest.c index 2159ed02..6e54b447 100644 --- a/expecttest.c +++ b/expecttest.c @@ -1,4 +1,6 @@ #include +#include +#include #include #include #include @@ -10,10 +12,24 @@ int main(void) { stbbr_start(5230); + stbbr_for("roster", + "" + "" + "" + "" + "" + "" + ); int res = 0; - int fd = exp_spawnl("./profanity"); + int fd = exp_spawnl("./profanity", NULL); FILE *fp = fdopen(fd, "r+"); + + if (fp == NULL) { + perror(NULL); + return 0; + } + setbuf(fp, (char *)0); res = exp_expectl(fd, exp_exact, "Profanity. Type /help for help information.", 10, exp_end); @@ -28,10 +44,19 @@ int main(void) assert(res == 12); res = exp_expectl(fd, exp_exact, "stabber@localhost logged in successfully", 13, exp_end); assert(res == 13); + + sleep(1); + assert(stbbr_verify( + "" + "" + "" + )); + + stbbr_send(); write(fd, QUIT_CMD, strlen(QUIT_CMD)); sleep(1); - + printf("\n"); printf("\n"); printf("PID: %d\n", exp_pid);