+
+#define STREQUALTEST(x, y) cout << "==(\"" << x << ",\"" << y "\") " << ((passed = (x == y)) ? "SUCCESS\n" : "FAILURE\n")
+
+bool TestSuite::DoCommaSepStreamTests()
+{
+ bool passed = false;
+ irc::commasepstream items("this,is,a,comma,stream");
+ std::string item;
+ int idx = 0;
+
+ while (items.GetToken(item))
+ {
+ idx++;
+
+ switch (idx)
+ {
+ case 1:
+ STREQUALTEST(item, "this");
+ break;
+ case 2:
+ STREQUALTEST(item, "is");
+ break;
+ case 3:
+ STREQUALTEST(item, "a");
+ break;
+ case 4:
+ STREQUALTEST(item, "comma");
+ break;
+ case 5:
+ STREQUALTEST(item, "stream");
+ break;
+ default:
+ cout << "COMMASEPSTREAM: FAILURE: Got an index too many! " << idx << " items\n";
+ break;
+ }
+ }
+
+ return true;
+}
+
+bool TestSuite::DoSpaceSepStreamTests()
+{
+ bool passed = false;
+
+ irc::spacesepstream list("this is a space stream");
+ std::string item;
+ int idx = 0;
+
+ while (list.GetToken(item))
+ {
+ idx++;
+
+ switch (idx)
+ {
+ case 1:
+ STREQUALTEST(item, "this");
+ break;
+ case 2:
+ STREQUALTEST(item, "is");
+ break;
+ case 3:
+ STREQUALTEST(item, "a");
+ break;
+ case 4:
+ STREQUALTEST(item, "space");
+ break;
+ case 5:
+ STREQUALTEST(item, "stream");
+ break;
+ default:
+ cout << "SPACESEPSTREAM: FAILURE: Got an index too many! " << idx << " items\n";
+ break;
+ }
+ }
+ return true;
+}
+