about summary refs log tree commit diff stats
path: root/same-fringe.mu
Commit message (Expand)AuthorAgeFilesLines
* 4261 - start using literals for 'true' and 'false'Kartik Agaram2018-06-171-4/+4
* 4160 - named marks for delimited continuationsKartik K. Agaram2017-12-151-5/+5
* 4157Kartik K. Agaram2017-12-091-2/+2
* 4156Kartik K. Agaram2017-12-071-1/+1
* 4154Kartik K. Agaram2017-12-071-0/+89
a> 58 59
#include <glib.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
#include <string.h>

#include <stabber.h>
#include <expect.h>

#include "proftest.h"

void
message_send(void **state)
{
    prof_connect();

    prof_input("/msg somejid@someserver.com Hi there");

    assert_true(stbbr_received(
        "<message id='*' to='somejid@someserver.com' type='chat'>"
            "<body>Hi there</body>"
        "</message>"
    ));

    assert_true(prof_output_regex("me: .+Hi there"));
}

void
message_receive_console(void **state)
{
    prof_connect();

    stbbr_send(
        "<message id='message1' to='stabber@localhost' from='someuser@chatserv.org/laptop' type='chat'>"
            "<body>How are you?</body>"
        "</message>"
    );

    assert_true(prof_output_exact("<< chat message: someuser@chatserv.org/laptop (win 2)"));
}

void
message_receive_chatwin(void **state)
{
    prof_connect();

    prof_input("/msg someuser@chatserv.org");
    assert_true(prof_output_exact("someuser@chatserv.org"));

    stbbr_send(
        "<message id='message1' to='stabber@localhost' from='someuser@chatserv.org/laptop' type='chat'>"
            "<body>How are you?</body>"
        "</message>"
    );

    assert_true(prof_output_regex("someuser@chatserv.org/laptop: .+How are you?"));
}