Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <list>
#include "RegExpOptimizeTest.h"
#include "regexp/unbounded/UnboundedRegExp.h"
#include "regexp/RegExpFromStringParser.h"
#include "regexp/RegExpOptimize.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::RegExpOptimize opt;
regexp::UnboundedRegExp res = opt.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() ) );
}
}