about summary refs log tree commit diff stats
path: root/019functions.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-07-20 22:30:02 -0700
committerKartik Agaram <vc@akkartik.com>2020-07-20 22:30:02 -0700
commitac6af96c5ac2ad5295334f273003eb66807ec3eb (patch)
tree99f275495023ded17020dba56ab209b57ebfa3fb /019functions.cc
parent3a5512389ed0f545fff82723f16bdea69f2e4b85 (diff)
downloadmu-ac6af96c5ac2ad5295334f273003eb66807ec3eb.tar.gz
6662 - start support for generics
Mu will be a language with generics -- but no static dispatch.
Diffstat (limited to '019functions.cc')
0 files changed, 0 insertions, 0 deletions
/a> ^
0331cbe2 ^


0331cbe2 ^



9537592b ^
0331cbe2 ^







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45








                      

                  
                       




                                                           


                                                    
                                                                   







                                                         


                                                  



                                                    
                                                                







                                           
#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"

void cmd_sub_shows_message_when_not_connected(void **state)
{
    CommandHelp *help = malloc(sizeof(CommandHelp));
    gchar *args[] = { NULL };

    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);

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

    gboolean result = cmd_sub(args, *help);
    assert_true(result);

    free(help);
}

void cmd_sub_shows_usage_when_no_arg(void **state)
{
    CommandHelp *help = malloc(sizeof(CommandHelp));
    help->usage = "Some usage";
    gchar *args[] = { NULL };

    will_return(jabber_get_connection_status, JABBER_CONNECTED);

    expect_cons_show("Usage: Some usage");

    gboolean result = cmd_sub(args, *help);
    assert_true(result);

    free(help);
}