diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-14 22:18:46 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | adcc04cc5a0b04aed753a4d1246bebd51236bf77 (patch) | |
tree | fe3fd8a972347ebeadedbea15dc3e51b71474e04 /tests/unit | |
parent | e5996f626b573e955c78dd680211700b3f5f42b3 (diff) | |
download | weechat-adcc04cc5a0b04aed753a4d1246bebd51236bf77.zip |
irc: fix extraction of address from prefix
Do not return the nick when the address is missing.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/plugins/irc/test-irc-message.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/unit/plugins/irc/test-irc-message.cpp b/tests/unit/plugins/irc/test-irc-message.cpp index d8c1a5e73..25a0d33e8 100644 --- a/tests/unit/plugins/irc/test-irc-message.cpp +++ b/tests/unit/plugins/irc/test-irc-message.cpp @@ -912,19 +912,13 @@ TEST(IrcMessage, GetAddressFromHost) { POINTERS_EQUAL(NULL, irc_message_get_address_from_host (NULL)); STRCMP_EQUAL("", irc_message_get_address_from_host ("")); - STRCMP_EQUAL("host", irc_message_get_address_from_host ("host")); - STRCMP_EQUAL("host", irc_message_get_address_from_host ("host ")); - STRCMP_EQUAL("host", irc_message_get_address_from_host ("host test")); - STRCMP_EQUAL("host", irc_message_get_address_from_host (":host ")); + STRCMP_EQUAL("", irc_message_get_address_from_host ("host")); + STRCMP_EQUAL("", irc_message_get_address_from_host ("host ")); + STRCMP_EQUAL("", irc_message_get_address_from_host ("host test")); + STRCMP_EQUAL("", irc_message_get_address_from_host (":host ")); STRCMP_EQUAL("host", irc_message_get_address_from_host (":nick!host")); STRCMP_EQUAL("user@host", irc_message_get_address_from_host (":nick!user@host")); - STRCMP_EQUAL("nick_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - "x_64_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - "xxxx_128_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - "xxxxxxxxxxxx_25", - irc_message_get_address_from_host (NICK_256_WITH_SPACE)); } /* |