summary refs log tree commit diff stats
path: root/tests/macros/ttryparseexpr.nim
Commit message (Expand)AuthorAgeFilesLines
* revert parser stmtListExpr (#11007)cooldome2019-04-171-3/+2
* Support for stmtListExpr in parser after major keywords. Scaled down version....cooldome2019-03-181-2/+3
* Remove expr/stmt (#5857)Arne Döring2017-07-251-1/+1
* minor lexer cleanups; fixes #2504Araq2015-04-101-0/+1
* fixes error propagation for macros.parseExprAraq2014-11-131-2/+4
* fixes #1473Araq2014-11-121-0/+17
ty/commit/tests/test_cmd_sub.c?id=9537592b52a8a96026c233cef8cd9834c23c2f69'>9537592b ^
976f3e30 ^







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);
}