Newer
Older
#include <list>
#include "RegExpOptimizeTest.h"
#include "regexp/unbounded/UnboundedRegExp.h"
#include <factory/StringDataFactory.hpp>
#define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y))
#define CPPUNIT_EXCLUSIVE_OR(x, y) CPPUNIT_ASSERT((!(x) && (y)) || ((x) && !(y)))
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( RegExpOptimizeTest, "regexp" );
CPPUNIT_TEST_SUITE_REGISTRATION( RegExpOptimizeTest );
void RegExpOptimizeTest::setUp() {
}
void RegExpOptimizeTest::tearDown() {
}
void RegExpOptimizeTest::testOptimize() {
{
std::string input = "(a+a)b + (#0 b + (#0 a + (#0 b + a)))";
regexp::UnboundedRegExp regexp( static_cast<const regexp::UnboundedRegExp &>( alib::StringDataFactory::fromString<regexp::RegExp>(input).getData() ) );
regexp::UnboundedRegExp res = regexp::simplify::RegExpOptimize::optimize(regexp);
regexp::UnboundedRegExp regexp( static_cast<const regexp::UnboundedRegExp &>( alib::StringDataFactory::fromString<regexp::RegExp>(input).getData() ) );