1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-10-06 20:03:46 -04:00

Test usage shown for /sub

This commit is contained in:
James Booth 2013-12-27 22:12:39 +00:00
parent 976f3e303a
commit 0331cbe249
3 changed files with 19 additions and 0 deletions

View File

@ -29,3 +29,20 @@ void cmd_sub_shows_message_when_not_connected(void **state)
free(help);
}
void cmd_sub_shows_usage_when_no_arg(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_sub(args, *help);
assert_true(result);
free(help);
}

View File

@ -1 +1,2 @@
void cmd_sub_shows_message_when_not_connected(void **state);
void cmd_sub_shows_usage_when_no_arg(void **state);

View File

@ -255,6 +255,7 @@ int main(int argc, char* argv[]) {
unit_test(cmd_account_clear_shows_message_when_invalid_property),
unit_test(cmd_sub_shows_message_when_not_connected),
unit_test(cmd_sub_shows_usage_when_no_arg),
};
return run_tests(tests);