summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-03-16 20:49:50 +0100
committerSébastien Helleu <flashcode@flashtux.org>2020-03-16 20:49:50 +0100
commit332a4adc260b94060ca20240641f3c1e02001ae5 (patch)
tree984e3f6605a81ad2450cdf39fdc1343a150a6439 /tests
parentf33cfc89a06d01883aa4067868ecdcc8b095273d (diff)
downloadweechat-332a4adc260b94060ca20240641f3c1e02001ae5.zip
tests: add tests on function irc_protocol_cb_chghost
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/plugins/irc/test-irc-protocol.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp
index 6be0f78f6..f165423f6 100644
--- a/tests/unit/plugins/irc/test-irc-protocol.cpp
+++ b/tests/unit/plugins/irc/test-irc-protocol.cpp
@@ -365,6 +365,29 @@ TEST(IrcProtocolWithServer, away)
/*
* Tests functions:
+ * irc_protocol_cb_chghost
+ */
+
+TEST(IrcProtocolWithServer, chghost)
+{
+ struct t_irc_nick *ptr_nick;
+
+ server_recv (":server 001 alice");
+ server_recv (":alice!user@host JOIN #test");
+
+ ptr_nick = ptr_server->channels->nicks;
+
+ STRCMP_EQUAL("user@host", ptr_nick->host);
+
+ server_recv (":alice!user@host CHGHOST user2 host2");
+ STRCMP_EQUAL("user2@host2", ptr_nick->host);
+
+ server_recv (":alice!user2@host2 CHGHOST user3 :host3");
+ STRCMP_EQUAL("user3@host3", ptr_nick->host);
+}
+
+/*
+ * Tests functions:
* irc_protocol_cb_001 (empty)
*/