summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-20 17:44:04 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-20 17:44:04 +0000
commita2b94d7a8b3fa734cf56164595a23b442da96daf (patch)
tree8001a91411c38b34b9612883b82b57cfdbc47954
parentb519d4b51b9e15af4013b24102faa478be3434b1 (diff)
Add test suite tests for wildcard function for failures discovered by Ankit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10563 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/testsuite.cpp98
1 files changed, 55 insertions, 43 deletions
diff --git a/src/testsuite.cpp b/src/testsuite.cpp
index 8343aed27..083839ff9 100644
--- a/src/testsuite.cpp
+++ b/src/testsuite.cpp
@@ -1,12 +1,12 @@
-/* +------------------------------------+
- * | Inspire Internet Relay Chat Daemon |
- * +------------------------------------+
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
*
* InspIRCd: (C) 2002-2008 InspIRCd Development Team
* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
- * the file COPYING for details.
+ * the file COPYING for details.
*
* ---------------------------------------------------
*/
@@ -111,45 +111,57 @@ bool TestSuite::DoWildTests()
cout << "\n\nWildcard and CIDR tests\n\n";
bool passed = false;
- WCTEST("foobar", "*");
- WCTEST("foobar", "foo*");
- WCTEST("foobar", "*bar");
- WCTEST("foobar", "foo??r");
- WCTEST("foobar.test", "fo?bar.*t");
- WCTEST("foobar.test", "fo?bar.t*t");
- WCTEST("foobar.tttt", "fo?bar.**t");
- WCTEST("foobar", "foobar");
- WCTEST("foobar", "foo***bar");
- WCTEST("foobar", "*foo***bar");
- WCTEST("foobar", "**foo***bar");
- WCTEST("foobar", "**foobar*");
- WCTEST("foobar", "**foobar**");
- WCTEST("foobar", "**foobar");
- WCTEST("foobar", "**f?*?ar");
- WCTEST("foobar", "**f?*b?r");
- WCTEST("foofar", "**f?*f*r");
- WCTEST("foofar", "**f?*f*?");
- WCTEST("r", "*");
- WCTEST("", "");
- WCTEST("test@foo.bar.test", "*@*.bar.test");
- WCTEST("test@foo.bar.test", "*test*@*.bar.test");
- WCTEST("test@foo.bar.test", "*@*test");
-
- WCTESTNOT("foobar", "bazqux");
- WCTESTNOT("foobar", "*qux");
- WCTESTNOT("foobar", "foo*x");
- WCTESTNOT("foobar", "baz*");
- WCTESTNOT("foobar", "foo???r");
- WCTESTNOT("foobar", "foobars");
- WCTESTNOT("foobar", "**foobar**h");
- WCTESTNOT("foobar", "**foobar**h*");
- WCTESTNOT("foobar", "**f??*bar?");
- WCTESTNOT("foobar", "");
- WCTESTNOT("", "foobar");
- WCTESTNOT("OperServ", "O");
- WCTESTNOT("O", "OperServ");
- WCTESTNOT("foobar.tst", "fo?bar.*g");
- WCTESTNOT("foobar.test", "fo?bar.*tt");
+ WCTEST("foobar", "*");
+ WCTEST("foobar", "foo*");
+ WCTEST("foobar", "*bar");
+ WCTEST("foobar", "foo??r");
+ WCTEST("foobar.test", "fo?bar.*t");
+ WCTEST("foobar.test", "fo?bar.t*t");
+ WCTEST("foobar.tttt", "fo?bar.**t");
+ WCTEST("foobar", "foobar");
+ WCTEST("foobar", "foo***bar");
+ WCTEST("foobar", "*foo***bar");
+ WCTEST("foobar", "**foo***bar");
+ WCTEST("foobar", "**foobar*");
+ WCTEST("foobar", "**foobar**");
+ WCTEST("foobar", "**foobar");
+ WCTEST("foobar", "**f?*?ar");
+ WCTEST("foobar", "**f?*b?r");
+ WCTEST("foofar", "**f?*f*r");
+ WCTEST("foofar", "**f?*f*?");
+ WCTEST("r", "*");
+ WCTEST("", "");
+ WCTEST("test@foo.bar.test", "*@*.bar.test");
+ WCTEST("test@foo.bar.test", "*test*@*.bar.test");
+ WCTEST("test@foo.bar.test", "*@*test");
+
+ WCTEST("a", "*a");
+ WCTEST("aa", "*a");
+ WCTEST("aaa", "*a");
+ WCTEST("aaaa", "*a");
+ WCTEST("aaaaa", "*a");
+ WCTEST("aaaaaa", "*a");
+ WCTEST("aaaaaaa", "*a");
+ WCTEST("aaaaaaaa", "*a");
+ WCTEST("aaaaaaaaa", "*a");
+ WCTEST("aaaaaaaaaa", "*a");
+ WCTEST("aaaaaaaaaaa", "*a");
+
+ WCTESTNOT("foobar", "bazqux");
+ WCTESTNOT("foobar", "*qux");
+ WCTESTNOT("foobar", "foo*x");
+ WCTESTNOT("foobar", "baz*");
+ WCTESTNOT("foobar", "foo???r");
+ WCTESTNOT("foobar", "foobars");
+ WCTESTNOT("foobar", "**foobar**h");
+ WCTESTNOT("foobar", "**foobar**h*");
+ WCTESTNOT("foobar", "**f??*bar?");
+ WCTESTNOT("foobar", "");
+ WCTESTNOT("", "foobar");
+ WCTESTNOT("OperServ", "O");
+ WCTESTNOT("O", "OperServ");
+ WCTESTNOT("foobar.tst", "fo?bar.*g");
+ WCTESTNOT("foobar.test", "fo?bar.*tt");
CIDRTEST("brain@1.2.3.4", "*@1.2.0.0/16");
CIDRTEST("brain@1.2.3.4", "*@1.2.3.0/24");