summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-08-13 22:47:22 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-08-13 22:47:22 +0200
commitaee3da54524a52a52573be2fd0777bbf43acc179 (patch)
tree81a607222f69a5f5ba2fc10b0c58eef1e0808bd0 /tests
parentd3b84eaf6c5235b473b46d83234d10369861b039 (diff)
downloadweechat-aee3da54524a52a52573be2fd0777bbf43acc179.zip
irc: add options and display SETNAME command in channels and private buffers (closes #1805)
New options: - irc.color.message_setname - irc.look.smart_filter_setname
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/plugins/irc/test-irc-protocol.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp
index 7240cd461..55098a96f 100644
--- a/tests/unit/plugins/irc/test-irc-protocol.cpp
+++ b/tests/unit/plugins/irc/test-irc-protocol.cpp
@@ -1847,7 +1847,7 @@ TEST(IrcProtocolWithServer, setname_without_setname_cap)
/* real name of "bob" has changed */
RECV(":bob!user@host SETNAME :new bob realname ");
- CHECK_SRV("-- Real name of bob has been set to \"new bob realname \"");
+ CHECK_CHAN("-- bob has changed real name to \"new bob realname \"");
POINTERS_EQUAL(NULL, ptr_nick->realname);
/* self real name has changed */
@@ -1863,21 +1863,29 @@ TEST(IrcProtocolWithServer, setname_without_setname_cap)
TEST(IrcProtocolWithServer, setname_with_setname_cap)
{
- struct t_irc_nick *ptr_nick;
+ struct t_irc_nick *ptr_nick, *ptr_nick2;
/* assume "setname" capability is enabled in server */
hashtable_set (ptr_server->cap_list, "setname", NULL);
- SRV_INIT_JOIN;
+ SRV_INIT_JOIN2;
ptr_nick = ptr_server->channels->nicks;
+ ptr_nick2 = ptr_server->channels->last_nick;
POINTERS_EQUAL(NULL, ptr_nick->realname);
+ /* real name of "bob" has changed */
+ RECV(":bob!user@host SETNAME :new bob realname ");
+ CHECK_CHAN("-- bob has changed real name to \"new bob realname \"");
+ STRCMP_EQUAL("new bob realname ", ptr_nick2->realname);
+
+ /* self real name has changed */
RECV(":alice!user@host SETNAME :new realname");
CHECK_SRV("-- Your real name has been set to \"new realname\"");
STRCMP_EQUAL("new realname", ptr_nick->realname);
+ /* self real name has changed */
RECV(":alice!user@host SETNAME :new realname2");
CHECK_SRV("-- Your real name has been set to \"new realname2\"");
STRCMP_EQUAL("new realname2", ptr_nick->realname);