summaryrefslogtreecommitdiff
path: root/tests/unit/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-07-02 21:11:32 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-07-02 21:11:32 +0200
commit6ffebec1a6005c0400b1935e83ac67f333da9b60 (patch)
treefcc5be143dc4fd962ba68ea399ab6d33f816c5ea /tests/unit/plugins
parent1c7b431bc8118207c7b54c8edfa0e5faab032c0d (diff)
downloadweechat-6ffebec1a6005c0400b1935e83ac67f333da9b60.zip
tests: add tests on IRC messages 524/704/705/706 (issue #1772)
Diffstat (limited to 'tests/unit/plugins')
-rw-r--r--tests/unit/plugins/irc/test-irc-protocol.cpp85
1 files changed, 85 insertions, 0 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp
index d6c4ca47e..dc7079c7a 100644
--- a/tests/unit/plugins/irc/test-irc-protocol.cpp
+++ b/tests/unit/plugins/irc/test-irc-protocol.cpp
@@ -3872,6 +3872,91 @@ TEST(IrcProtocolWithServer, 470)
/*
* Tests functions:
+ * irc_protocol_cb_524 (help not found)
+ */
+
+TEST(IrcProtocolWithServer, 524)
+{
+ SRV_INIT;
+
+ /* not enough parameters */
+ RECV(":server 524");
+ CHECK_ERROR_PARAMS("524", 0, 2);
+ RECV(":server 524 alice");
+ CHECK_ERROR_PARAMS("524", 1, 2);
+
+ RECV(":server 524 alice UNKNOWN");
+ CHECK_SRV("--");
+ RECV(":server 524 alice UNKNOWN :Help not found");
+ CHECK_SRV("-- Help not found");
+}
+
+/*
+ * Tests functions:
+ * irc_protocol_cb_704 (start of HELP/HELPOP)
+ */
+
+TEST(IrcProtocolWithServer, 704)
+{
+ SRV_INIT;
+
+ /* not enough parameters */
+ RECV(":server 704");
+ CHECK_ERROR_PARAMS("704", 0, 2);
+ RECV(":server 704 alice");
+ CHECK_ERROR_PARAMS("704", 1, 2);
+
+ RECV(":server 704 alice MODE");
+ CHECK_SRV("--");
+ RECV(":server 704 alice MODE "
+ ":MODE <target> [<modestring> [<mode arguments>...]]");
+ CHECK_SRV("-- MODE <target> [<modestring> [<mode arguments>...]]");
+}
+
+/*
+ * Tests functions:
+ * irc_protocol_cb_705 (body of HELP/HELPOP)
+ */
+
+TEST(IrcProtocolWithServer, 705)
+{
+ SRV_INIT;
+
+ /* not enough parameters */
+ RECV(":server 705");
+ CHECK_ERROR_PARAMS("705", 0, 2);
+ RECV(":server 705 alice");
+ CHECK_ERROR_PARAMS("705", 1, 2);
+
+ RECV(":server 705 alice MODE");
+ CHECK_SRV("--");
+ RECV(":server 705 alice MODE :Sets and removes modes from the given target.");
+ CHECK_SRV("-- Sets and removes modes from the given target.");
+}
+
+/*
+ * Tests functions:
+ * irc_protocol_cb_706 (end of HELP/HELPOP)
+ */
+
+TEST(IrcProtocolWithServer, 706)
+{
+ SRV_INIT;
+
+ /* not enough parameters */
+ RECV(":server 706");
+ CHECK_ERROR_PARAMS("706", 0, 2);
+ RECV(":server 706 alice");
+ CHECK_ERROR_PARAMS("706", 1, 2);
+
+ RECV(":server 706 alice MODE");
+ CHECK_SRV("--");
+ RECV(":server 706 alice MODE :End of /HELPOP");
+ CHECK_SRV("-- End of /HELPOP");
+}
+
+/*
+ * Tests functions:
* irc_protocol_cb_728 (quietlist)
*/