]> jfr.im git - irc/weechat/weechat.git/commitdiff
tests: add tests on manual CTCP ACTION sent to IRC channel
authorSébastien Helleu <redacted>
Mon, 29 May 2023 09:13:49 +0000 (11:13 +0200)
committerSébastien Helleu <redacted>
Mon, 29 May 2023 09:13:49 +0000 (11:13 +0200)
tests/unit/plugins/irc/test-irc-protocol.cpp

index 34aa242ff7c2c5188d9c8abe807a747a6101fa21..d15256dc356a0442ccbd3e985877d105abdb0d70 100644 (file)
@@ -714,6 +714,20 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage)
                "irc_privmsg,irc_action,self_msg,notify_none,no_highlight,"
                "nick_alice,log1");
 
+    /* action on channel (with raw code: "\01ACTION") */
+    server_input_data (buffer_chan, "\01ACTION is testing\01");
+    CHECK_SENT("PRIVMSG #test :\01ACTION is testing\01");
+    CHECK_CHAN(" *", "alice is testing",
+               "irc_privmsg,irc_action,self_msg,notify_none,no_highlight,"
+               "nick_alice,log1");
+
+    /* action on channel (with raw code: "\01ACTION"), no message */
+    server_input_data (buffer_chan, "\01ACTION\01");
+    CHECK_SENT("PRIVMSG #test :\01ACTION\01");
+    CHECK_CHAN(" *", "alice",
+               "irc_privmsg,irc_action,self_msg,notify_none,no_highlight,"
+               "nick_alice,log1");
+
     /* action on channel (with /action *) */
     server_input_data (buffer_chan, "/action * action chan 2");
     CHECK_SENT("PRIVMSG #test :\01ACTION action chan 2\01");
@@ -925,6 +939,16 @@ TEST(IrcProtocolWithServer, SendMessagesWithEchoMessage)
     CHECK_SENT("PRIVMSG #test :\01ACTION\01");
     CHECK_NO_MSG;
 
+    /* action on channel (with raw code: "\01ACTION") */
+    server_input_data (buffer_chan, "\01ACTION is testing\01");
+    CHECK_SENT("PRIVMSG #test :\01ACTION is testing\01");
+    CHECK_NO_MSG;
+
+    /* action on channel (with raw code: "\01ACTION"), no message */
+    server_input_data (buffer_chan, "\01ACTION\01");
+    CHECK_SENT("PRIVMSG #test :\01ACTION\01");
+    CHECK_NO_MSG;
+
     /* action on channel (with /action *) */
     server_input_data (buffer_chan, "/action * action chan 2");
     CHECK_SENT("PRIVMSG #test :\01ACTION action chan 2\01");