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:
parent
976f3e303a
commit
0331cbe249
@ -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);
|
||||
}
|
||||
|
@ -1 +1,2 @@
|
||||
void cmd_sub_shows_message_when_not_connected(void **state);
|
||||
void cmd_sub_shows_usage_when_no_arg(void **state);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user