ISupport

Members

Functions

insertToken
void insertToken(string token, Nullable!string val)

Variables

allowsOperOverride
bool allowsOperOverride;
awayLength
ulong awayLength;
banExceptions
Nullable!char banExceptions;
banExtensions
Nullable!BanExtension banExtensions;
cNotice
bool cNotice;
cPrivmsg
bool cPrivmsg;
callerID
Nullable!char callerID;
caseMapping
CaseMapping caseMapping;
chanLimits
ulong[char] chanLimits;
channelIDLengths
ulong[char] channelIDLengths;
channelLength
ulong channelLength;
channelModeTypes
ModeType[char] channelModeTypes;
channelTypes
string channelTypes;
charSet
string charSet;
deaf
Nullable!char deaf;
extendedList
string extendedList;
extendedSilence
bool extendedSilence;
forcedNickChanges
bool forcedNickChanges;
inviteExceptions
Nullable!char inviteExceptions;
kickLength
ulong kickLength;
knock
bool knock;
languages
string[] languages;
lineLength
ulong lineLength;
logsOperCommands
bool logsOperCommands;
maxLanguages
ulong maxLanguages;
maxList
ulong[char] maxList;
maxModesPerCommand
ulong maxModesPerCommand;
maxTargets
ulong maxTargets;
maximumParameters
ulong maximumParameters;
maximumWatches
Nullable!ulong maximumWatches;
metadata
Nullable!ulong metadata;
monitorTargetLimit
Nullable!ulong monitorTargetLimit;
namesExtended
bool namesExtended;
network
string network;
nickLength
ulong nickLength;
noQuit
bool noQuit;
penalty
bool penalty;
prefixes
char[char] prefixes;
rfc2812
bool rfc2812;
safeList
bool safeList;
secureList
bool secureList;
silence
Nullable!ulong silence;
sslServer
string sslServer;
standard
Nullable!string standard;
startTLS
bool startTLS;
statusMessage
string statusMessage;
supportsMap
bool supportsMap;
supportsRemove
bool supportsRemove;
targetMaxByCommand
ulong[string] targetMaxByCommand;
topicLength
Nullable!ulong topicLength;
unknownTokens
string[string] unknownTokens;
userIP
bool userIP;
userLength
Nullable!ulong userLength;
userhostsInNames
bool userhostsInNames;
variableBanList
bool variableBanList;
virtualChannels
bool virtualChannels;
wAllChannelOps
bool wAllChannelOps;
wAllChannelVoices
bool wAllChannelVoices;
whoX
bool whoX;

Examples

1 import virc.casemapping : CaseMapping;
2 import virc.modes : ModeType;
3 auto isupport = ISupport();
4 {
5 	assert(isupport.awayLength == ulong.max);
6 	isupport.insertToken(keyValuePair("AWAYLEN=8"));
7 	assert(isupport.awayLength == 8);
8 	isupport.insertToken(keyValuePair("AWAYLEN="));
9 	assert(isupport.awayLength == ulong.max);
10 	isupport.insertToken(keyValuePair("AWAYLEN=8"));
11 	assert(isupport.awayLength == 8);
12 	isupport.insertToken(keyValuePair("-AWAYLEN"));
13 	assert(isupport.awayLength == ulong.max);
14 }
15 {
16 	assert(isupport.callerID.isNull);
17 	isupport.insertToken(keyValuePair("CALLERID=h"));
18 	assert(isupport.callerID.get == 'h');
19 	isupport.insertToken(keyValuePair("CALLERID"));
20 	assert(isupport.callerID.get == 'g');
21 	isupport.insertToken(keyValuePair("-CALLERID"));
22 	assert(isupport.callerID.isNull);
23 }
24 {
25 	assert(isupport.caseMapping == CaseMapping.unknown);
26 	isupport.insertToken(keyValuePair("CASEMAPPING=rfc1459"));
27 	assert(isupport.caseMapping == CaseMapping.rfc1459);
28 	isupport.insertToken(keyValuePair("CASEMAPPING=ascii"));
29 	assert(isupport.caseMapping == CaseMapping.ascii);
30 	isupport.insertToken(keyValuePair("CASEMAPPING=rfc3454"));
31 	assert(isupport.caseMapping == CaseMapping.rfc3454);
32 	isupport.insertToken(keyValuePair("CASEMAPPING=strict-rfc1459"));
33 	assert(isupport.caseMapping == CaseMapping.strictRFC1459);
34 	isupport.insertToken(keyValuePair("-CASEMAPPING"));
35 	assert(isupport.caseMapping == CaseMapping.unknown);
36 	isupport.insertToken(keyValuePair("CASEMAPPING=something"));
37 	assert(isupport.caseMapping == CaseMapping.unknown);
38 }
39 {
40 	assert(isupport.chanLimits.length == 0);
41 	isupport.insertToken(keyValuePair("CHANLIMIT=#+:25,&:"));
42 	assert(isupport.chanLimits['#'] == 25);
43 	assert(isupport.chanLimits['+'] == 25);
44 	assert(isupport.chanLimits['&'] == ulong.max);
45 	isupport.insertToken(keyValuePair("-CHANLIMIT"));
46 	assert(isupport.chanLimits.length == 0);
47 	isupport.insertToken(keyValuePair("CHANLIMIT=q"));
48 	assert(isupport.chanLimits.length == 0);
49 	isupport.insertToken(keyValuePair("CHANLIMIT=!:f"));
50 	assert(isupport.chanLimits.length == 0);
51 }
52 {
53 	assert(isupport.channelModeTypes.length == 0);
54 	isupport.insertToken(keyValuePair("CHANMODES=b,k,l,imnpst"));
55 	assert(isupport.channelModeTypes['b'] == ModeType.a);
56 	assert(isupport.channelModeTypes['k'] == ModeType.b);
57 	assert(isupport.channelModeTypes['l'] == ModeType.c);
58 	assert(isupport.channelModeTypes['i'] == ModeType.d);
59 	assert(isupport.channelModeTypes['t'] == ModeType.d);
60 	isupport.insertToken(keyValuePair("CHANMODES=beI,k,l,BCMNORScimnpstz"));
61 	assert(isupport.channelModeTypes['e'] == ModeType.a);
62 	isupport.insertToken(keyValuePair("CHANMODES"));
63 	assert(isupport.channelModeTypes.length == 0);
64 	isupport.insertToken(keyValuePair("CHANMODES=w,,,"));
65 	assert(isupport.channelModeTypes['w'] == ModeType.a);
66 	assert('b' !in isupport.channelModeTypes);
67 	isupport.insertToken(keyValuePair("-CHANMODES"));
68 	assert(isupport.channelModeTypes.length == 0);
69 }
70 {
71 	assert(isupport.channelLength == 200);
72 	isupport.insertToken(keyValuePair("CHANNELLEN=50"));
73 	assert(isupport.channelLength == 50);
74 	isupport.insertToken(keyValuePair("CHANNELLEN="));
75 	assert(isupport.channelLength == ulong.max);
76 	isupport.insertToken(keyValuePair("-CHANNELLEN"));
77 	assert(isupport.channelLength == 200);
78 }
79 {
80 	assert(isupport.channelTypes == "#&!+");
81 	isupport.insertToken(keyValuePair("CHANTYPES=&#"));
82 	assert(isupport.channelTypes == "&#");
83 	isupport.insertToken(keyValuePair("CHANTYPES"));
84 	assert(isupport.channelTypes == "");
85 	isupport.insertToken(keyValuePair("-CHANTYPES"));
86 	assert(isupport.channelTypes == "#&!+");
87 }
88 {
89 	assert(isupport.charSet == "");
90 	isupport.insertToken(keyValuePair("CHARSET=ascii"));
91 	assert(isupport.charSet == "ascii");
92 	isupport.insertToken(keyValuePair("CHARSET"));
93 	assert(isupport.charSet == "");
94 	isupport.insertToken(keyValuePair("-CHARSET"));
95 	assert(isupport.charSet == "");
96 }
97 {
98 	assert('!' !in isupport.channelIDLengths);
99 	isupport.insertToken(keyValuePair("CHIDLEN=5"));
100 	assert(isupport.channelIDLengths['!'] == 5);
101 	isupport.insertToken(keyValuePair("-CHIDLEN"));
102 	assert('!' !in isupport.channelIDLengths);
103 }
104 {
105 	assert(!isupport.cNotice);
106 	isupport.insertToken(keyValuePair("CNOTICE"));
107 	assert(isupport.cNotice);
108 	isupport.insertToken(keyValuePair("-CNOTICE"));
109 	assert(!isupport.cNotice);
110 }
111 {
112 	assert(!isupport.cPrivmsg);
113 	isupport.insertToken(keyValuePair("CPRIVMSG"));
114 	assert(isupport.cPrivmsg);
115 	isupport.insertToken(keyValuePair("-CPRIVMSG"));
116 	assert(!isupport.cPrivmsg);
117 }
118 {
119 	assert(isupport.deaf.isNull);
120 	isupport.insertToken(keyValuePair("DEAF=D"));
121 	assert(isupport.deaf.get == 'D');
122 	isupport.insertToken(keyValuePair("DEAF"));
123 	assert(isupport.deaf.get == 'd');
124 	isupport.insertToken(keyValuePair("-DEAF"));
125 	assert(isupport.deaf.isNull);
126 }
127 {
128 	assert(isupport.extendedList == "");
129 	isupport.insertToken(keyValuePair("ELIST=CMNTU"));
130 	assert(isupport.extendedList == "CMNTU");
131 	isupport.insertToken(keyValuePair("-ELIST"));
132 	assert(isupport.extendedList == "");
133 }
134 {
135 	assert(isupport.banExceptions.isNull);
136 	isupport.insertToken(keyValuePair("EXCEPTS"));
137 	assert(isupport.banExceptions == 'e');
138 	isupport.insertToken(keyValuePair("EXCEPTS=f"));
139 	assert(isupport.banExceptions == 'f');
140 	isupport.insertToken(keyValuePair("EXCEPTS=e"));
141 	assert(isupport.banExceptions == 'e');
142 	isupport.insertToken(keyValuePair("-EXCEPTS"));
143 	assert(isupport.banExceptions.isNull);
144 }
145 {
146 	assert(isupport.banExtensions.isNull);
147 	isupport.insertToken(keyValuePair("EXTBAN=~,cqnr"));
148 	assert(isupport.banExtensions.get.prefix == '~');
149 	assert(isupport.banExtensions.get.banTypes == "cqnr");
150 	isupport.insertToken(keyValuePair("EXTBAN=,ABCNOQRSTUcjmprsz"));
151 	assert(isupport.banExtensions.get.prefix.isNull);
152 	assert(isupport.banExtensions.get.banTypes == "ABCNOQRSTUcjmprsz");
153 	isupport.insertToken(keyValuePair("EXTBAN=~,qjncrRa"));
154 	assert(isupport.banExtensions.get.prefix == '~');
155 	assert(isupport.banExtensions.get.banTypes == "qjncrRa");
156 	isupport.insertToken(keyValuePair("-EXTBAN"));
157 	assert(isupport.banExtensions.isNull);
158 	isupport.insertToken(keyValuePair("EXTBAN=8"));
159 	assert(isupport.banExtensions.isNull);
160 }
161 {
162 	assert(isupport.forcedNickChanges == false);
163 	isupport.insertToken(keyValuePair("FNC"));
164 	assert(isupport.forcedNickChanges == true);
165 	isupport.insertToken(keyValuePair("-FNC"));
166 	assert(isupport.forcedNickChanges == false);
167 }
168 {
169 	assert(isupport.channelIDLengths.length == 0);
170 	isupport.insertToken(keyValuePair("IDCHAN=!:5"));
171 	assert(isupport.channelIDLengths['!'] == 5);
172 	isupport.insertToken(keyValuePair("-IDCHAN"));
173 	assert(isupport.channelIDLengths.length == 0);
174 }
175 {
176 	assert(isupport.inviteExceptions.isNull);
177 	isupport.insertToken(keyValuePair("INVEX"));
178 	assert(isupport.inviteExceptions.get == 'I');
179 	isupport.insertToken(keyValuePair("INVEX=q"));
180 	assert(isupport.inviteExceptions.get == 'q');
181 	isupport.insertToken(keyValuePair("INVEX=I"));
182 	assert(isupport.inviteExceptions.get == 'I');
183 	isupport.insertToken(keyValuePair("-INVEX"));
184 	assert(isupport.inviteExceptions.isNull);
185 }
186 {
187 	assert(isupport.kickLength == ulong.max);
188 	isupport.insertToken(keyValuePair("KICKLEN=180"));
189 	assert(isupport.kickLength == 180);
190 	isupport.insertToken(keyValuePair("KICKLEN="));
191 	assert(isupport.kickLength == ulong.max);
192 	isupport.insertToken(keyValuePair("KICKLEN=2"));
193 	isupport.insertToken(keyValuePair("-KICKLEN"));
194 	assert(isupport.kickLength == ulong.max);
195 }
196 {
197 	assert(!isupport.knock);
198 	isupport.insertToken(keyValuePair("KNOCK"));
199 	assert(isupport.knock);
200 	isupport.insertToken(keyValuePair("-KNOCK"));
201 	assert(!isupport.knock);
202 }
203 {
204 	import std.algorithm.searching : canFind;
205 	assert(isupport.languages.length == 0);
206 	isupport.insertToken(keyValuePair("LANGUAGE=2,en,i-klingon"));
207 	assert(isupport.languages.canFind("en"));
208 	assert(isupport.languages.canFind("i-klingon"));
209 	isupport.insertToken(keyValuePair("-LANGUAGE"));
210 	assert(isupport.languages.length == 0);
211 }
212 {
213 	assert(isupport.lineLength == 512);
214 	isupport.insertToken(keyValuePair("LINELEN=2048"));
215 	assert(isupport.lineLength == 2048);
216 	isupport.insertToken(keyValuePair("LINELEN=512"));
217 	assert(isupport.lineLength == 512);
218 	isupport.insertToken(keyValuePair("LINELEN=2"));
219 	assert(isupport.lineLength == 2);
220 	isupport.insertToken(keyValuePair("-LINELEN"));
221 	assert(isupport.lineLength == 512);
222 }
223 {
224 	assert(!isupport.supportsMap);
225 	isupport.insertToken(keyValuePair("MAP"));
226 	assert(isupport.supportsMap);
227 	isupport.insertToken(keyValuePair("-MAP"));
228 	assert(!isupport.supportsMap);
229 }
230 {
231 	assert('b' !in isupport.maxList);
232 	isupport.insertToken(keyValuePair("MAXBANS=5"));
233 	assert(isupport.maxList['b'] == 5);
234 	isupport.insertToken(keyValuePair("-MAXBANS"));
235 	assert('b' !in isupport.maxList);
236 }
237 {
238 	assert('#' !in isupport.chanLimits);
239 	isupport.insertToken(keyValuePair("MAXCHANNELS=25"));
240 	assert(isupport.chanLimits['#'] == 25);
241 	isupport.insertToken(keyValuePair("-MAXCHANNELS"));
242 	assert('#' !in isupport.chanLimits);
243 }
244 {
245 	assert(isupport.maxList.length == 0);
246 	isupport.insertToken(keyValuePair("MAXLIST=beI:25"));
247 	assert(isupport.maxList['b'] == 25);
248 	assert(isupport.maxList['e'] == 25);
249 	assert(isupport.maxList['I'] == 25);
250 	isupport.insertToken(keyValuePair("MAXLIST=b:25,eI:50"));
251 	assert(isupport.maxList['b'] == 25);
252 	assert(isupport.maxList['e'] == 50);
253 	assert(isupport.maxList['I'] == 50);
254 	isupport.insertToken(keyValuePair("-MAXLIST"));
255 	assert(isupport.maxList.length == 0);
256 }
257 {
258 	assert(isupport.maximumParameters == 12);
259 	isupport.insertToken(keyValuePair("MAXPARA=32"));
260 	assert(isupport.maximumParameters == 32);
261 	isupport.insertToken(keyValuePair("-MAXPARA"));
262 	assert(isupport.maximumParameters == 12);
263 }
264 {
265 	assert(isupport.maxTargets == ulong.max);
266 	isupport.insertToken(keyValuePair("MAXTARGETS=8"));
267 	assert(isupport.maxTargets == 8);
268 	isupport.insertToken(keyValuePair("-MAXTARGETS"));
269 	assert(isupport.maxTargets == ulong.max);
270 }
271 {
272 	assert(isupport.metadata.isNull);
273 	isupport.insertToken(keyValuePair("METADATA=30"));
274 	assert(isupport.metadata == 30);
275 	isupport.insertToken(keyValuePair("METADATA=x"));
276 	assert(isupport.metadata.isNull);
277 	isupport.insertToken(keyValuePair("METADATA"));
278 	assert(isupport.metadata == ulong.max);
279 	isupport.insertToken(keyValuePair("-METADATA"));
280 	assert(isupport.metadata.isNull);
281 }
282 {
283 	//As specified in RFC1459, default number of "variable" modes is 3 per command.
284 	assert(isupport.maxModesPerCommand == 3);
285 	isupport.insertToken(keyValuePair("MODES"));
286 	assert(isupport.maxModesPerCommand == ulong.max);
287 	isupport.insertToken(keyValuePair("MODES=3"));
288 	assert(isupport.maxModesPerCommand == 3);
289 	isupport.insertToken(keyValuePair("MODES=5"));
290 	assert(isupport.maxModesPerCommand == 5);
291 	isupport.insertToken(keyValuePair("-MODES"));
292 	assert(isupport.maxModesPerCommand == 3);
293 }
294 {
295 	assert(isupport.monitorTargetLimit.isNull);
296 	isupport.insertToken(keyValuePair("MONITOR=6"));
297 	assert(isupport.monitorTargetLimit == 6);
298 	isupport.insertToken(keyValuePair("MONITOR"));
299 	assert(isupport.monitorTargetLimit == ulong.max);
300 	isupport.insertToken(keyValuePair("-MONITOR"));
301 	assert(isupport.monitorTargetLimit.isNull);
302 }
303 {
304 	assert(!isupport.namesExtended);
305 	isupport.insertToken(keyValuePair("NAMESX"));
306 	assert(isupport.namesExtended);
307 	isupport.insertToken(keyValuePair("-NAMESX"));
308 	assert(!isupport.namesExtended);
309 }
310 {
311 	assert(isupport.network == "");
312 	isupport.insertToken(keyValuePair("NETWORK=EFNet"));
313 	assert(isupport.network == "EFNet");
314 	isupport.insertToken(keyValuePair("NETWORK=Rizon"));
315 	assert(isupport.network == "Rizon");
316 	isupport.insertToken(keyValuePair("-NETWORK"));
317 	assert(isupport.network == "");
318 }
319 {
320 	assert(isupport.nickLength == 9);
321 	isupport.insertToken(keyValuePair("NICKLEN=32"));
322 	assert(isupport.nickLength == 32);
323 	isupport.insertToken(keyValuePair("NICKLEN=9"));
324 	assert(isupport.nickLength == 9);
325 	isupport.insertToken(keyValuePair("NICKLEN=32"));
326 	isupport.insertToken(keyValuePair("-NICKLEN"));
327 	assert(isupport.nickLength == 9);
328 }
329 {
330 	assert(!isupport.noQuit);
331 	isupport.insertToken(keyValuePair("NOQUIT"));
332 	assert(isupport.noQuit);
333 	isupport.insertToken(keyValuePair("-NOQUIT"));
334 	assert(!isupport.noQuit);
335 }
336 {
337 	assert(!isupport.allowsOperOverride);
338 	isupport.insertToken(keyValuePair("OVERRIDE"));
339 	assert(isupport.allowsOperOverride);
340 	isupport.insertToken(keyValuePair("-OVERRIDE"));
341 	assert(!isupport.allowsOperOverride);
342 }
343 {
344 	assert(!isupport.penalty);
345 	isupport.insertToken(keyValuePair("PENALTY"));
346 	assert(isupport.penalty);
347 	isupport.insertToken(keyValuePair("-PENALTY"));
348 	assert(!isupport.penalty);
349 }
350 {
351 	//assert(isupport.prefixes == ['o': '@', 'v': '+']);
352 	isupport.insertToken(keyValuePair("PREFIX"));
353 	assert(isupport.prefixes.length == 0);
354 	isupport.insertToken(keyValuePair("PREFIX=(ov)@+"));
355 	assert(isupport.prefixes == ['o': '@', 'v': '+']);
356 	isupport.insertToken(keyValuePair("PREFIX=(qaohv)~&@%+"));
357 	assert(isupport.prefixes == ['o': '@', 'v': '+', 'q': '~', 'a': '&', 'h': '%']);
358 	isupport.insertToken(keyValuePair("-PREFIX"));
359 	assert(isupport.prefixes == ['o': '@', 'v': '+']);
360 }
361 {
362 	assert(!isupport.rfc2812);
363 	isupport.insertToken(keyValuePair("RFC2812"));
364 	assert(isupport.rfc2812);
365 	isupport.insertToken(keyValuePair("-RFC2812"));
366 	assert(!isupport.rfc2812);
367 }
368 {
369 	assert(!isupport.safeList);
370 	isupport.insertToken(keyValuePair("SAFELIST"));
371 	assert(isupport.safeList);
372 	isupport.insertToken(keyValuePair("-SAFELIST"));
373 	assert(!isupport.safeList);
374 }
375 {
376 	assert(!isupport.secureList);
377 	isupport.insertToken(keyValuePair("SECURELIST"));
378 	assert(isupport.secureList);
379 	isupport.insertToken(keyValuePair("-SECURELIST"));
380 	assert(!isupport.secureList);
381 }
382 {
383 	assert(isupport.silence.isNull);
384 	isupport.insertToken(keyValuePair("SILENCE=15"));
385 	assert(isupport.silence == 15);
386 	isupport.insertToken(keyValuePair("SILENCE"));
387 	assert(isupport.silence == ulong.max);
388 	isupport.insertToken(keyValuePair("-SILENCE"));
389 	assert(isupport.silence.isNull);
390 }
391 {
392 	assert(isupport.sslServer == "");
393 	isupport.insertToken(keyValuePair("SSL=1.2.3.4:6668;4.3.2.1:6669;*:6660;"));
394 	assert(isupport.sslServer == "1.2.3.4:6668;4.3.2.1:6669;*:6660;");
395 	isupport.insertToken(keyValuePair("-SSL"));
396 	assert(isupport.sslServer == "");
397 }
398 {
399 	assert(!isupport.startTLS);
400 	isupport.insertToken(keyValuePair("STARTTLS"));
401 	assert(isupport.startTLS);
402 	isupport.insertToken(keyValuePair("-STARTTLS"));
403 	assert(!isupport.startTLS);
404 }
405 {
406 	assert(isupport.statusMessage == "");
407 	isupport.insertToken(keyValuePair("STATUSMSG=@+"));
408 	assert(isupport.statusMessage == "@+");
409 	isupport.insertToken(keyValuePair("-STATUSMSG"));
410 	assert(isupport.statusMessage == "");
411 }
412 {
413 	assert(isupport.standard.isNull);
414 	isupport.insertToken(keyValuePair("STD=i-d"));
415 	assert(isupport.standard == "i-d");
416 	isupport.insertToken(keyValuePair("-STD"));
417 	assert(isupport.standard.isNull);
418 }
419 {
420 	assert(isupport.targetMaxByCommand.length == 0);
421 	isupport.insertToken(keyValuePair("TARGMAX=PRIVMSG:3,WHOIS:1,JOIN:"));
422 	assert(isupport.targetMaxByCommand["PRIVMSG"]== 3);
423 	assert(isupport.targetMaxByCommand["WHOIS"]== 1);
424 	assert(isupport.targetMaxByCommand["JOIN"]== ulong.max);
425 	isupport.insertToken(keyValuePair("TARGMAX"));
426 	assert(isupport.targetMaxByCommand.length == 0);
427 	isupport.insertToken(keyValuePair("-TARGMAX"));
428 	assert(isupport.targetMaxByCommand.length == 0);
429 }
430 {
431 	assert(isupport.topicLength.isNull);
432 	isupport.insertToken(keyValuePair("TOPICLEN=120"));
433 	assert(isupport.topicLength == 120);
434 	isupport.insertToken(keyValuePair("TOPICLEN="));
435 	assert(isupport.topicLength == ulong.max);
436 	isupport.insertToken(keyValuePair("-TOPICLEN"));
437 	assert(isupport.topicLength.isNull);
438 }
439 {
440 	assert(!isupport.userhostsInNames);
441 	isupport.insertToken(keyValuePair("UHNAMES"));
442 	assert(isupport.userhostsInNames);
443 	isupport.insertToken(keyValuePair("-UHNAMES"));
444 	assert(!isupport.userhostsInNames);
445 }
446 {
447 	assert(!isupport.userIP);
448 	isupport.insertToken(keyValuePair("USERIP"));
449 	assert(isupport.userIP);
450 	isupport.insertToken(keyValuePair("-USERIP"));
451 	assert(!isupport.userIP);
452 }
453 {
454 	assert(isupport.userLength.isNull);
455 	isupport.insertToken(keyValuePair("USERLEN=12"));
456 	assert(isupport.userLength == 12);
457 	isupport.insertToken(keyValuePair("USERLEN="));
458 	assert(isupport.userLength == ulong.max);
459 	isupport.insertToken(keyValuePair("-USERLEN"));
460 	assert(isupport.userLength.isNull);
461 }
462 {
463 	assert(!isupport.variableBanList);
464 	isupport.insertToken(keyValuePair("VBANLIST"));
465 	assert(isupport.variableBanList);
466 	isupport.insertToken(keyValuePair("-VBANLIST"));
467 	assert(!isupport.variableBanList);
468 }
469 {
470 	assert(!isupport.virtualChannels);
471 	isupport.insertToken(keyValuePair("VCHANS"));
472 	assert(isupport.virtualChannels);
473 	isupport.insertToken(keyValuePair("-VCHANS"));
474 	assert(!isupport.virtualChannels);
475 }
476 {
477 	assert(!isupport.wAllChannelOps);
478 	isupport.insertToken(keyValuePair("WALLCHOPS"));
479 	assert(isupport.wAllChannelOps);
480 	isupport.insertToken(keyValuePair("-WALLCHOPS"));
481 	assert(!isupport.wAllChannelOps);
482 }
483 {
484 	assert(!isupport.wAllChannelVoices);
485 	isupport.insertToken(keyValuePair("WALLVOICES"));
486 	assert(isupport.wAllChannelVoices);
487 	isupport.insertToken(keyValuePair("-WALLVOICES"));
488 	assert(!isupport.wAllChannelVoices);
489 }
490 {
491 	assert(isupport.maximumWatches.isNull);
492 	isupport.insertToken(keyValuePair("WATCH=100"));
493 	assert(isupport.maximumWatches == 100);
494 	isupport.insertToken(keyValuePair("WATCH"));
495 	assert(isupport.maximumWatches == ulong.max);
496 	isupport.insertToken(keyValuePair("-WATCH"));
497 	assert(isupport.maximumWatches.isNull);
498 }
499 {
500 	assert(!isupport.whoX);
501 	isupport.insertToken(keyValuePair("WHOX"));
502 	assert(isupport.whoX);
503 	isupport.insertToken(keyValuePair("-WHOX"));
504 	assert(!isupport.whoX);
505 }
506 {
507 	assert(isupport.unknownTokens.length == 0);
508 	isupport.insertToken(keyValuePair("WHOA"));
509 	assert(isupport.unknownTokens["WHOA"] == "");
510 	isupport.insertToken(keyValuePair("WHOA=AOHW"));
511 	assert(isupport.unknownTokens["WHOA"] == "AOHW");
512 	isupport.insertToken(keyValuePair("WHOA=0"));
513 	isupport.insertToken(keyValuePair("WHOA2=1"));
514 	assert(isupport.unknownTokens["WHOA"] == "0");
515 	assert(isupport.unknownTokens["WHOA2"] == "1");
516 	isupport.insertToken(keyValuePair("-WHOA"));
517 	isupport.insertToken(keyValuePair("-WHOA2"));
518 	assert(isupport.unknownTokens.length == 0);
519 }

Meta