From ac83130dd7a42134551381b86e4bb47bbc24b3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 14 May 2023 14:09:01 +0200 Subject: [PATCH] irc: add test of privmsg message parsing with empty text --- tests/unit/plugins/irc/test-irc-message.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/plugins/irc/test-irc-message.cpp b/tests/unit/plugins/irc/test-irc-message.cpp index e5a840248..39a232c5a 100644 --- a/tests/unit/plugins/irc/test-irc-message.cpp +++ b/tests/unit/plugins/irc/test-irc-message.cpp @@ -486,6 +486,7 @@ TEST(IrcMessage, Parse) const char *params_part[] = { "#channel", NULL }; const char *params_invite[] = { "nick2", "#channel", NULL }; const char *params_privmsg_no_msg[] = { "#channel", NULL }; + const char *params_privmsg_empty_msg[] = { "#channel", "", NULL }; const char *params_privmsg[] = { "#channel", "the message", NULL }; const char *params_privmsg_nick2[] = { "nick2", "the message", NULL }; const char *params_005[] = { @@ -657,6 +658,11 @@ TEST(IrcMessage, Parse) params_privmsg_no_msg, 1, 16, 24, 24, -1, NULL, ":nick!user@host PRIVMSG #channel"); + WEE_CHECK_PARSE(NULL, ":nick!user@host PRIVMSG #channel :", "nick", "user", + "nick!user@host", "PRIVMSG", "#channel", "#channel :", "", + params_privmsg_empty_msg, 1, + 16, 24, 24, 34, + NULL, ":nick!user@host PRIVMSG #channel :"); WEE_CHECK_PARSE(NULL, ":nick!user@host PRIVMSG #channel :the message", "nick", "user", "nick!user@host", "PRIVMSG", "#channel", "#channel :the message", "the message",