summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-12-29 11:19:39 +0100
committerFlorent Le Coz <louiz@louiz.org>2016-01-04 13:47:27 +0100
commita38b17692e0297cbd5d719f059bd0a1b6ef39fe4 (patch)
tree9780d21d143ac49baa3117bb12fff85922c3988d /tests
parentdfcb0a6e0e975b7a4fd3b9ca3cb340fc1859d7f9 (diff)
downloadbiboumi-a38b17692e0297cbd5d719f059bd0a1b6ef39fe4.tar.gz
biboumi-a38b17692e0297cbd5d719f059bd0a1b6ef39fe4.tar.bz2
biboumi-a38b17692e0297cbd5d719f059bd0a1b6ef39fe4.tar.xz
biboumi-a38b17692e0297cbd5d719f059bd0a1b6ef39fe4.zip
Support multi-prefix
See http://ircv3.net/specs/extensions/multi-prefix-3.1.html ref #3103
Diffstat (limited to 'tests')
-rw-r--r--tests/iid.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/iid.cpp b/tests/iid.cpp
index a90c208..74d010d 100644
--- a/tests/iid.cpp
+++ b/tests/iid.cpp
@@ -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
*/