summaryrefslogtreecommitdiff
path: root/tests/unit/plugins/irc/test-irc-nick.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-06-20 17:44:48 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-06-20 17:44:48 +0200
commit944661045252f38b08e1da32904317370b36cf74 (patch)
tree0e76666e180c30b75cbe3ccc87a7886f8a5ff014 /tests/unit/plugins/irc/test-irc-nick.cpp
parent12051a506ddbb0fe37ec9ebcc4b5df1eaeaa23bf (diff)
downloadweechat-944661045252f38b08e1da32904317370b36cf74.zip
tests: add test of function irc_nick_is_nick with invalid UTF-8 string
Diffstat (limited to 'tests/unit/plugins/irc/test-irc-nick.cpp')
-rw-r--r--tests/unit/plugins/irc/test-irc-nick.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/plugins/irc/test-irc-nick.cpp b/tests/unit/plugins/irc/test-irc-nick.cpp
index a114e24f0..8f0d7ea17 100644
--- a/tests/unit/plugins/irc/test-irc-nick.cpp
+++ b/tests/unit/plugins/irc/test-irc-nick.cpp
@@ -108,6 +108,9 @@ TEST(IrcNick, IsNick)
LONGS_EQUAL(0, irc_nick_is_nick (server, "nick!test"));
LONGS_EQUAL(0, irc_nick_is_nick (server, "nick@test"));
+ /* invalid UTF-8 */
+ LONGS_EQUAL(0, irc_nick_is_nick (server, "no\xc3l"));
+
/* valid nicks: UTF-8 */
LONGS_EQUAL(1, irc_nick_is_nick (server, "noël"));
LONGS_EQUAL(1, irc_nick_is_nick (server, "testé"));