diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-16 18:18:27 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | aad86a1955050db6dbfaceaed293dafd2799c3f9 (patch) | |
tree | 54ee3af9bab389655b4d08d88e8b3595f54c6df8 /tests/unit/plugins/irc/test-irc-protocol.cpp | |
parent | dcbf534d53775ede1407ba1eaa1c3f4d2f1d135e (diff) | |
download | weechat-aad86a1955050db6dbfaceaed293dafd2799c3f9.zip |
irc: use parsed command parameters in "366" command callback
Diffstat (limited to 'tests/unit/plugins/irc/test-irc-protocol.cpp')
-rw-r--r-- | tests/unit/plugins/irc/test-irc-protocol.cpp | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 49f28d7e7..8216108eb 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -3518,21 +3518,45 @@ TEST(IrcProtocolWithServer, 354) TEST(IrcProtocolWithServer, 366) { - SRV_INIT_JOIN2; + SRV_INIT_JOIN; - /* not enough arguments */ + /* not enough parameters */ RECV(":server 366"); - CHECK_ERROR_ARGS("366", 2, 5); + CHECK_ERROR_PARAMS("366", 0, 3); RECV(":server 366 alice"); - CHECK_ERROR_ARGS("366", 3, 5); + CHECK_ERROR_PARAMS("366", 1, 3); RECV(":server 366 alice #test"); - CHECK_ERROR_ARGS("366", 4, 5); + CHECK_ERROR_PARAMS("366", 2, 3); RECV(":server 366 alice #test end"); - CHECK_CHAN("-- Channel #test: 2 nicks (0 ops, 0 voices, 2 normals)"); + CHECK_CHAN("-- Channel #test: 1 nick (0 ops, 0 voices, 1 normal)"); + RECV(":server 366 alice #test :End of /NAMES list"); + CHECK_CHAN("-- Channel #test: 1 nick (0 ops, 0 voices, 1 normal)"); + + RECV(":server 353 alice = #test :bob"); RECV(":server 366 alice #test :End of /NAMES list"); CHECK_CHAN("-- Channel #test: 2 nicks (0 ops, 0 voices, 2 normals)"); + RECV(":server 353 alice = #test :@carol"); + RECV(":server 366 alice #test :End of /NAMES list"); + CHECK_CHAN("-- Channel #test: 3 nicks (1 op, 0 voices, 2 normals)"); + + RECV(":server 353 alice = #test :+dan!user@host"); + RECV(":server 366 alice #test :End of /NAMES list"); + CHECK_CHAN("-- Channel #test: 4 nicks (1 op, 1 voice, 2 normals)"); + + RECV(":server 353 alice = #test :@evans"); + RECV(":server 366 alice #test :End of /NAMES list"); + CHECK_CHAN("-- Channel #test: 5 nicks (2 ops, 1 voice, 2 normals)"); + + RECV(":server 353 alice = #test :+fred"); + RECV(":server 366 alice #test :End of /NAMES list"); + CHECK_CHAN("-- Channel #test: 6 nicks (2 ops, 2 voices, 2 normals)"); + + RECV(":server 353 alice = #test :greg"); + RECV(":server 366 alice #test :End of /NAMES list"); + CHECK_CHAN("-- Channel #test: 7 nicks (2 ops, 2 voices, 3 normals)"); + /* channel not found */ RECV(":server 366 alice #xyz end"); CHECK_SRV("-- #xyz: end"); |