diff options
Diffstat (limited to 'tests/test_cmd_bookmark.c')
-rw-r--r-- | tests/test_cmd_bookmark.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_cmd_bookmark.c b/tests/test_cmd_bookmark.c new file mode 100644 index 00000000..59f5c02e --- /dev/null +++ b/tests/test_cmd_bookmark.c @@ -0,0 +1,30 @@ +#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 "xmpp/mock_xmpp.h" + +#include "command/commands.h" + +#include "ui/mock_ui.h" + +void cmd_bookmark_shows_usage_when_no_args(void **state) +{ + mock_cons_show(); + CommandHelp *help = malloc(sizeof(CommandHelp)); + help->usage = "some usage"; + gchar *args[] = { NULL }; + + mock_connection_status(JABBER_CONNECTED); + expect_cons_show("Usage: some usage"); + + gboolean result = cmd_bookmark(args, *help); + assert_true(result); + + free(help); +} |