diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-14 23:08:45 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | 179822fb91a6dae34a22cf35f174c0df68917230 (patch) | |
tree | e78ce0419dc708ad6e69a46db2f9ef5b93dce12f /tests/unit/plugins/irc/test-irc-protocol.cpp | |
parent | 5e712d7145846b9b16a8dbc40ec06f2b8c1a7273 (diff) | |
download | weechat-179822fb91a6dae34a22cf35f174c0df68917230.zip |
irc: use parsed command parameters in "privmsg" command callback
Diffstat (limited to 'tests/unit/plugins/irc/test-irc-protocol.cpp')
-rw-r--r-- | tests/unit/plugins/irc/test-irc-protocol.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index c3b9233b6..66dddac08 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -1566,13 +1566,17 @@ TEST(IrcProtocolWithServer, privmsg) SRV_INIT_JOIN2; - /* not enough arguments */ + /* not enough parameters */ RECV(":bob!user@host PRIVMSG"); - CHECK_ERROR_ARGS("privmsg", 2, 4); + CHECK_ERROR_PARAMS("privmsg", 0, 2); RECV(":bob!user@host PRIVMSG #test"); - CHECK_ERROR_ARGS("privmsg", 3, 4); + CHECK_ERROR_PARAMS("privmsg", 1, 2); RECV(":bob!user@host PRIVMSG alice"); - CHECK_ERROR_ARGS("privmsg", 3, 4); + CHECK_ERROR_PARAMS("privmsg", 1, 2); + + /* missing nick */ + RECV("PRIVMSG #test :this is the message"); + CHECK_ERROR_NICK("privmsg"); /* message to channel/user */ RECV(":bob!user@host PRIVMSG #test :this is the message"); |