about summary refs log tree commit diff stats
path: root/tests/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-01-30 23:28:02 +0000
committerJames Booth <boothj5@gmail.com>2015-01-30 23:28:02 +0000
commit83bd207316037a8086f15f37c0e187a2ffba2e14 (patch)
treeb4788d1a1b55f7bb5c6b83f0e76bc7aecdb34c2d /tests/ui
parent2cdbfc7eb7d90ed286c6c5f432990166cdec0b93 (diff)
downloadprofani-tty-83bd207316037a8086f15f37c0e187a2ffba2e14.tar.gz
Moved readline code to inputwin.c
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/stub_ui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/stub_ui.c b/tests/ui/stub_ui.c
index 6b9050c3..6127e4f0 100644
--- a/tests/ui/stub_ui.c
+++ b/tests/ui/stub_ui.c
@@ -323,9 +323,9 @@ void ui_update_presence(const resource_presence_t resource_presence,
 void ui_about(void) {}
 void ui_statusbar_new(const int win) {}
 
-char * ui_readline(void)
+gboolean ui_readline(void)
 {
-    return NULL;
+    return TRUE;
 }
 
 void ui_inp_history_append(char *inp) {}
mber */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#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?"));
}