mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Added tests for "/account set <status> <priority>" with invalid status
This commit is contained in:
parent
76e7a8341b
commit
ba66d6b730
@ -805,3 +805,37 @@ void cmd_account_set_status_shows_message_when_set_last(void **state)
|
||||
|
||||
free(help);
|
||||
}
|
||||
|
||||
void cmd_account_set_invalid_presence_string_priority_shows_message(void **state)
|
||||
{
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
gchar *args[] = { "set", "a_account", "blah", "10", NULL };
|
||||
|
||||
expect_any(accounts_account_exists, account_name);
|
||||
will_return(accounts_account_exists, TRUE);
|
||||
|
||||
expect_string(cons_show, output, "Invalid property: blah");
|
||||
expect_string(cons_show, output, "");
|
||||
|
||||
gboolean result = cmd_account(args, *help);
|
||||
assert_true(result);
|
||||
|
||||
free(help);
|
||||
}
|
||||
|
||||
void cmd_account_set_last_priority_shows_message(void **state)
|
||||
{
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
gchar *args[] = { "set", "a_account", "last", "10", NULL };
|
||||
|
||||
expect_any(accounts_account_exists, account_name);
|
||||
will_return(accounts_account_exists, TRUE);
|
||||
|
||||
expect_string(cons_show, output, "Invalid property: last");
|
||||
expect_string(cons_show, output, "");
|
||||
|
||||
gboolean result = cmd_account(args, *help);
|
||||
assert_true(result);
|
||||
|
||||
free(help);
|
||||
}
|
||||
|
@ -43,3 +43,5 @@ void cmd_account_set_status_sets_status_when_valid(void **state);
|
||||
void cmd_account_set_status_sets_status_when_last(void **state);
|
||||
void cmd_account_set_status_shows_message_when_set_valid(void **state);
|
||||
void cmd_account_set_status_shows_message_when_set_last(void **state);
|
||||
void cmd_account_set_invalid_presence_string_priority_shows_message(void **state);
|
||||
void cmd_account_set_last_priority_shows_message(void **state);
|
||||
|
@ -234,6 +234,8 @@ int main(int argc, char* argv[]) {
|
||||
unit_test(cmd_account_set_status_sets_status_when_last),
|
||||
unit_test(cmd_account_set_status_shows_message_when_set_valid),
|
||||
unit_test(cmd_account_set_status_shows_message_when_set_last),
|
||||
unit_test(cmd_account_set_invalid_presence_string_priority_shows_message),
|
||||
unit_test(cmd_account_set_last_priority_shows_message),
|
||||
};
|
||||
return run_tests(tests);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user