Newer
Older
#include <list>
#include "RegExpOptimizeTest.h"
#include "regexp/unbounded/UnboundedRegExp.h"
#include "regexp/RegExpFromStringParser.h"
#define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y))
#define CPPUNIT_EXCLUSIVE_OR(x, y) CPPUNIT_ASSERT((!(x) && (y)) || ((x) && !(y)))
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)))";
std::stringstream inputs(input);
regexp::RegExpFromStringParser parser(inputs);
regexp::UnboundedRegExp regexp( static_cast<const regexp::UnboundedRegExp &>( parser.parseValue().getData() ) );
regexp::UnboundedRegExp res = regexp::simplify::RegExpOptimize::optimize(regexp);
}
{
std::string input = "a+a* (b+a)* c";
std::stringstream inputs(input);
regexp::RegExpFromStringParser parser(inputs);
regexp::UnboundedRegExp regexp( static_cast<const regexp::UnboundedRegExp &>( parser.parseValue().getData() ) );
}
}