23 #include "testircisupportparser.h"
25 #include "irc/entities/ircuserprefix.h"
26 #include "irc/ircisupportparser.h"
27 #include "tests/asserts.h"
29 bool TestIRCISupportPrefix::executeTest()
32 parser.appendLine(
"AWAYLEN=300 CALLERID=g CASEMAPPING=rfc1459 "
33 "CHANMODES=IXZbegw,k,FHJLdfjl,ABCDKMNOPQRSTcimnprstuz CHANNELLEN=64 "
34 "CHANTYPES=# CHARSET=ascii ELIST=MU ESILENCE EXCEPTS=e "
35 "EXTBAN=,ABCNOQRSTUcjmprsz FNC INVEX=I :are supported by this server");
36 parser.appendLine(
"KICKLEN=420 MAP MAXBANS=60 MAXCHANNELS=75 MAXPARA=32 "
37 "MAXTARGETS=20 MODES=20 NAMESX NETWORK=ExampleNetwork NICKLEN=20 OPERLOG "
38 "OVERRIDE PREFIX=(ohav)@%^+ :are supported by this server");
39 parser.appendLine(
"REMOVE SECURELIST SILENCE=32 SSL=109.74.206.218:6697 "
40 "STARTTLS STATUSMSG=@%+ TOPICLEN=420 UHNAMES USERIP VBANLIST WALLCHOPS "
41 "WALLVOICES WATCH=64 :are supported by this server");
44 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'@'),
'o');
45 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'%'),
'h');
46 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'^'),
'a');
47 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'+'),
'v');
48 T_ASSERT_EQUAL(prefixes.prefixForMode(
'o'),
'@');
49 T_ASSERT_EQUAL(prefixes.prefixForMode(
'h'),
'%');
50 T_ASSERT_EQUAL(prefixes.prefixForMode(
'a'),
'^');
51 T_ASSERT_EQUAL(prefixes.prefixForMode(
'v'),
'+');
55 bool TestIRCISupportNoPrefix::executeTest()
58 parser.appendLine(
"AWAYLEN=300 :are supported by this server");
61 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'@'),
'o');
62 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'%'),
'h');
63 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'^'),
'\0');
64 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'+'),
'v');
65 T_ASSERT_EQUAL(prefixes.prefixForMode(
'o'),
'@');
66 T_ASSERT_EQUAL(prefixes.prefixForMode(
'h'),
'%');
67 T_ASSERT_EQUAL(prefixes.prefixForMode(
'a'),
'\0');
68 T_ASSERT_EQUAL(prefixes.prefixForMode(
'v'),
'+');