Support multi-prefix

See http://ircv3.net/specs/extensions/multi-prefix-3.1.html
ref #3103
This commit is contained in:
Florent Le Coz
2016-01-04 13:47:27 +01:00
parent dfcb0a6e0e
commit a38b17692e
3 changed files with 26 additions and 5 deletions
+9 -1
View File
@@ -8,7 +8,6 @@
TEST_CASE("Irc user parsing")
{
const std::map<char, char> prefixes{{'!', 'a'}, {'@', 'o'}};
IrcUser user1("!nick!~some@host.bla", prefixes);
CHECK(user1.nick == "nick");
CHECK(user1.host == "~some@host.bla");
@@ -22,6 +21,15 @@ TEST_CASE("Irc user parsing")
CHECK(user2.modes.find('a') == user2.modes.end());
}
TEST_CASE("multi-prefix")
{
const std::map<char, char> prefixes{{'!', 'a'}, {'@', 'o'}, {'~', 'f'}};
IrcUser user("!@~nick", prefixes);
CHECK(user.nick == "nick");
CHECK(user.modes.size() == 3);
CHECK(user.modes.find('f') != user.modes.end());
}
/**
* Let Catch know how to display Iid objects
*/