13 #include "../../terminalparser.hpp"
14 #include "../../wikiuser.hpp"
27 void testCaseTerminalParser();
30 HuggleTest::HuggleTest()
36 QVERIFY2(
Huggle::WikiUser(
"10.0.0.1").IsIP(),
"Invalid result for new WikiUser with username of IP, the result of IsIP() was false, but should have been true");
37 QVERIFY2(
Huggle::WikiUser(
"150.30.0.56").IsIP(),
"Invalid result for new WikiUser with username of IP, the result of IsIP() was false, but should have been true");
38 QVERIFY2((
Huggle::WikiUser(
"355.2.0.1").IsIP() ==
false),
"Invalid result for new WikiUser with username of IP, the result of IsIP() was true, but should have been false");
39 QVERIFY2((
Huggle::WikiUser(
"Frank").IsIP() ==
false),
"Invalid result for new WikiUser with username of IP, the result of IsIP() was true, but should have been false");
40 QVERIFY2((
Huggle::WikiUser(
"Joe").IsIP() ==
false),
"Invalid result for new WikiUser with username of IP, the result of IsIP() was true, but should have been false");
43 void HuggleTest::testCaseTerminalParser()
46 list.append(
"huggle");
50 QVERIFY2(p->Parse() ==
false,
"Invalid result for terminal parser");
51 list.append(
"-vvvvvvvvvvvvvvvvv");
55 QVERIFY2(p->Parse() ==
false,
"Invalid result for terminal parser");
56 list.append(
"-vvvvvvhvvvvvvv");
60 QVERIFY2(p->Parse() ==
true,
"Invalid result for terminal parser");
62 list.append(
"huggle");
63 list.append(
"--help");
67 QVERIFY2(p->Parse() ==
true,
"Invalid result for terminal parser");
69 list.append(
"huggle");
70 list.append(
"--safe");
74 QVERIFY2(p->Parse() ==
false,
"Invalid result for terminal parser");
76 list.append(
"huggle");
77 list.append(
"--blabla");
81 QVERIFY2(p->Parse() ==
true,
"Invalid result for terminal parser");
87 #include "tst_testmain.moc"
void testCaseWikiUserCheckIP()
Test if IsIP returns true for users who are IP's.
Parses the data provided by user.