about summary refs log blame commit diff stats
path: root/html/Readme
blob: fa19c7ef12fb545d382dca5aa52728a7aaf0973a (plain) (tree)
1
                                                                        
Rendered Mu sources. Go to https://akkartik.github.io/mu to browse them.
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 <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#include "xmpp/xmpp.h"

#include "ui/ui.h"
#include "ui/stub_ui.h"

#include "command/commands.h"

#define CMD_SUB "/sub"

void cmd_sub_shows_message_when_not_connected(void **state)
{
    gchar *args[] = { NULL };

    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);

    expect_cons_show("You are currently not connected.");

    gboolean result = cmd_sub(NULL, CMD_SUB, args);
    assert_true(result);
}

void cmd_sub_shows_usage_when_no_arg(void **state)
{
    gchar *args[] = { NULL };

    will_return(jabber_get_connection_status, JABBER_CONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_SUB);

    gboolean result = cmd_sub(NULL, CMD_SUB, args);
    assert_true(result);
}