23 #include "testircisupportparser.h" 25 #include "irc/entities/ircuserprefix.h" 26 #include "irc/ircisupportparser.h" 28 #define T_ASSERT_EQUAL(a, b) \ 34 bool TestIRCISupportPrefix::executeTest()
37 parser.appendLine(
"AWAYLEN=300 CALLERID=g CASEMAPPING=rfc1459 " 38 "CHANMODES=IXZbegw,k,FHJLdfjl,ABCDKMNOPQRSTcimnprstuz CHANNELLEN=64 " 39 "CHANTYPES=# CHARSET=ascii ELIST=MU ESILENCE EXCEPTS=e " 40 "EXTBAN=,ABCNOQRSTUcjmprsz FNC INVEX=I :are supported by this server");
41 parser.appendLine(
"KICKLEN=420 MAP MAXBANS=60 MAXCHANNELS=75 MAXPARA=32 " 42 "MAXTARGETS=20 MODES=20 NAMESX NETWORK=ExampleNetwork NICKLEN=20 OPERLOG " 43 "OVERRIDE PREFIX=(ohav)@%^+ :are supported by this server");
44 parser.appendLine(
"REMOVE SECURELIST SILENCE=32 SSL=109.74.206.218:6697 " 45 "STARTTLS STATUSMSG=@%+ TOPICLEN=420 UHNAMES USERIP VBANLIST WALLCHOPS " 46 "WALLVOICES WATCH=64 :are supported by this server");
49 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'@'),
'o');
50 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'%'),
'h');
51 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'^'),
'a');
52 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'+'),
'v');
53 T_ASSERT_EQUAL(prefixes.prefixForMode(
'o'),
'@');
54 T_ASSERT_EQUAL(prefixes.prefixForMode(
'h'),
'%');
55 T_ASSERT_EQUAL(prefixes.prefixForMode(
'a'),
'^');
56 T_ASSERT_EQUAL(prefixes.prefixForMode(
'v'),
'+');
60 bool TestIRCISupportNoPrefix::executeTest()
63 parser.appendLine(
"AWAYLEN=300 :are supported by this server");
66 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'@'),
'o');
67 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'%'),
'h');
68 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'^'),
'\0');
69 T_ASSERT_EQUAL(prefixes.modeForPrefix(
'+'),
'v');
70 T_ASSERT_EQUAL(prefixes.prefixForMode(
'o'),
'@');
71 T_ASSERT_EQUAL(prefixes.prefixForMode(
'h'),
'%');
72 T_ASSERT_EQUAL(prefixes.prefixForMode(
'a'),
'\0');
73 T_ASSERT_EQUAL(prefixes.prefixForMode(
'v'),
'+');
One-to-one association of visible prefixes to user mode.