/** @file
$Id$
$Date$
$Author$
@copy © Marc Wäckerlin
@license LGPL, see file COPYING
$Log$
Revision 1.1 2004/12/14 20:20:30 marc
initial version
*/
#include
#include
#include
#include
#include
class RegExpTest: public CppUnit::TestFixture {
public:
void CheckRegExp() {
mrw::RegExp findHalloWelt("^Hallo.*Welt$");
CPPUNIT_ASSERT(findHalloWelt("Hallo Meine Welt"));
CPPUNIT_ASSERT(!findHalloWelt("xxx"));
CPPUNIT_ASSERT(!findHalloWelt(""));
CPPUNIT_ASSERT(!findHalloWelt(" Hallo Welt "));
CPPUNIT_ASSERT(findHalloWelt("HalloWelt"));
}
CPPUNIT_TEST_SUITE(RegExpTest);
CPPUNIT_TEST(CheckRegExp);
CPPUNIT_TEST_SUITE_END();
};
CPPUNIT_TEST_SUITE_REGISTRATION(RegExpTest);
int main() {
CppUnit::TextUi::TestRunner runner;
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
return runner.run() ? 0 : 1;
}