summaryrefslogtreecommitdiff
path: root/tests/unit/plugins/irc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-10-11 00:02:49 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-10-17 21:28:31 +0200
commit1f83df7a18a9ac354e44ae422be85cfdc73c7c2a (patch)
tree9d2611a4b78d0dc332b027e1f694fcb2eef49837 /tests/unit/plugins/irc
parenteda8ad9de54a645b979d5b1fdd46638876a4c578 (diff)
downloadweechat-1f83df7a18a9ac354e44ae422be85cfdc73c7c2a.zip
irc: use parsed command parameters in "fail", "warn" and "note" command callbacks
Diffstat (limited to 'tests/unit/plugins/irc')
-rw-r--r--tests/unit/plugins/irc/test-irc-protocol.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp
index 037feeb9e..777012992 100644
--- a/tests/unit/plugins/irc/test-irc-protocol.cpp
+++ b/tests/unit/plugins/irc/test-irc-protocol.cpp
@@ -46,7 +46,8 @@ extern const char *irc_protocol_nick_address (struct t_irc_server *server,
struct t_irc_nick *nick,
const char *nickname,
const char *address);
-extern char *irc_protocol_string_params (const char **params, int start_arg);
+extern char *irc_protocol_string_params (const char **params,
+ int arg_start, int arg_end);
extern char *irc_protocol_cap_to_enable (const char *capabilities,
int sasl_requested);
}
@@ -320,27 +321,30 @@ TEST(IrcProtocol, StringParams)
const char *params_3[] = { "param1", "param2", "param3", NULL };
/* invalid arguments */
- WEE_TEST_STR("", irc_protocol_string_params (NULL, -1));
- WEE_TEST_STR("", irc_protocol_string_params (NULL, 0));
+ WEE_TEST_STR("", irc_protocol_string_params (NULL, -1, -1));
+ WEE_TEST_STR("", irc_protocol_string_params (NULL, 0, 0));
+ WEE_TEST_STR("", irc_protocol_string_params (NULL, 0, -1));
+ WEE_TEST_STR("", irc_protocol_string_params (params_1, 1, 0));
/* empty parameter */
- WEE_TEST_STR("", irc_protocol_string_params (params_empty, 0));
- WEE_TEST_STR("", irc_protocol_string_params (params_empty, 1));
+ WEE_TEST_STR("", irc_protocol_string_params (params_empty, 0, 0));
+ WEE_TEST_STR("", irc_protocol_string_params (params_empty, 1, 1));
/* one parameter */
- WEE_TEST_STR("param1", irc_protocol_string_params (params_1, 0));
- WEE_TEST_STR("", irc_protocol_string_params (params_1, 1));
+ WEE_TEST_STR("param1", irc_protocol_string_params (params_1, 0, 0));
+ WEE_TEST_STR("", irc_protocol_string_params (params_1, 1, 1));
/* two parameters */
- WEE_TEST_STR("param1 param2", irc_protocol_string_params (params_2, 0));
- WEE_TEST_STR("param2", irc_protocol_string_params (params_2, 1));
- WEE_TEST_STR("", irc_protocol_string_params (params_2, 2));
+ WEE_TEST_STR("param1 param2", irc_protocol_string_params (params_2, 0, 1));
+ WEE_TEST_STR("param2", irc_protocol_string_params (params_2, 1, 1));
+ WEE_TEST_STR("", irc_protocol_string_params (params_2, 2, 2));
/* three parameters */
- WEE_TEST_STR("param1 param2 param3", irc_protocol_string_params (params_3, 0));
- WEE_TEST_STR("param2 param3", irc_protocol_string_params (params_3, 1));
- WEE_TEST_STR("param3", irc_protocol_string_params (params_3, 2));
- WEE_TEST_STR("", irc_protocol_string_params (params_3, 3));
+ WEE_TEST_STR("param1 param2 param3", irc_protocol_string_params (params_3, 0, 2));
+ WEE_TEST_STR("param2 param3", irc_protocol_string_params (params_3, 1, 2));
+ WEE_TEST_STR("param2", irc_protocol_string_params (params_3, 1, 1));
+ WEE_TEST_STR("param3", irc_protocol_string_params (params_3, 2, 2));
+ WEE_TEST_STR("", irc_protocol_string_params (params_3, 3, 3));
}
TEST_GROUP(IrcProtocolWithServer)