diff options
Diffstat (limited to 'tests/test_cmd_account.c')
-rw-r--r-- | tests/test_cmd_account.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c index 33ba348b..ee4fb673 100644 --- a/tests/test_cmd_account.c +++ b/tests/test_cmd_account.c @@ -53,7 +53,7 @@ void cmd_account_shows_account_when_connected_and_no_args(void **state) void cmd_account_list_shows_accounts(void **state) { CommandHelp *help = malloc(sizeof(CommandHelp)); - gchar *args[] = { "list" }; + gchar *args[] = { "list", NULL }; gchar **accounts = malloc(sizeof(gchar *) * 4); accounts[0] = strdup("account1"); @@ -70,3 +70,17 @@ void cmd_account_list_shows_accounts(void **state) free(help); } + +void cmd_account_show_shows_usage_when_no_arg(void **state) +{ + CommandHelp *help = malloc(sizeof(CommandHelp)); + help->usage = "some usage"; + gchar *args[] = { "show", NULL }; + + expect_string(cons_show, output, "Usage: some usage"); + + gboolean result = cmd_account(args, *help); + assert_true(result); + + free(help); +} |