mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Added "/account show" test when no account supplied
This commit is contained in:
parent
6f060b583e
commit
8aaca1054f
@ -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);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
void cmd_account_shows_usage_when_not_connected_and_no_args(void **state);
|
||||
void cmd_account_shows_account_when_connected_and_no_args(void **state);
|
||||
void cmd_account_list_shows_accounts(void **state);
|
||||
void cmd_account_show_shows_usage_when_no_arg(void **state);
|
||||
|
@ -31,6 +31,7 @@ int main(int argc, char* argv[]) {
|
||||
unit_test(cmd_account_shows_usage_when_not_connected_and_no_args),
|
||||
unit_test(cmd_account_shows_account_when_connected_and_no_args),
|
||||
unit_test(cmd_account_list_shows_accounts),
|
||||
unit_test(cmd_account_show_shows_usage_when_no_arg),
|
||||
|
||||
unit_test(cmd_rooms_shows_message_when_disconnected),
|
||||
unit_test(cmd_rooms_shows_message_when_disconnecting),
|
||||
|
Loading…
Reference in New Issue
Block a user