diff --git a/alib2algo/test-src/regexp/simplify/RegExpOptimizeTest.cpp b/alib2algo/test-src/regexp/simplify/RegExpOptimizeTest.cpp index bc73260e63746088afb58db0ca1fdb93a68545b0..4343bc21bf36cc62e80972bee26749c2d4e3c573 100644 --- a/alib2algo/test-src/regexp/simplify/RegExpOptimizeTest.cpp +++ b/alib2algo/test-src/regexp/simplify/RegExpOptimizeTest.cpp @@ -29,7 +29,7 @@ void RegExpOptimizeTest::testOptimize() { regexp::UnboundedRegExp < > res = regexp::simplify::RegExpOptimize::optimize(regexp); std::string inputRes = "a"; - regexp::UnboundedRegExp < > regexpRes( static_cast<const regexp::UnboundedRegExp < > &>( alib::StringDataFactory::fromString<regexp::RegExp>(inputRes).getData() ) ); + regexp::UnboundedRegExp < > regexpRes( static_cast<const regexp::UnboundedRegExp < DefaultSymbolType > &>( alib::StringDataFactory::fromString<regexp::RegExp>(inputRes).getData() ) ); std::cout << res << std::endl; std::cout << regexpRes << std::endl; diff --git a/alib2algo/test-src/regexp/transform/RegExpConcatenateTest.cpp b/alib2algo/test-src/regexp/transform/RegExpConcatenateTest.cpp index 6c5cf4ab8364dd1f36871769e439b95a8a66d698..0dbfd78d00b13b889a466cf1cbac15e0109c9d42 100644 --- a/alib2algo/test-src/regexp/transform/RegExpConcatenateTest.cpp +++ b/alib2algo/test-src/regexp/transform/RegExpConcatenateTest.cpp @@ -35,7 +35,7 @@ void RegExpConcatenateTest::testRegExpConcatenate() { std::string input1 = "(#E a b)"; regexp::RegExp re1 = alib::StringDataFactory::fromString<regexp::RegExp>(input1); - regexp::RegExp re2(regexp::FormalRegExp < > (regexp::FormalRegExpStructure < alphabet::Symbol > (regexp::FormalRegExpConcatenation < alphabet::Symbol > (regexp::FormalRegExpEmpty < alphabet::Symbol > {}, regexp::FormalRegExpEpsilon < alphabet::Symbol > {})))); + regexp::RegExp re2(regexp::FormalRegExp < > (regexp::FormalRegExpStructure < DefaultSymbolType > (regexp::FormalRegExpConcatenation < DefaultSymbolType > (regexp::FormalRegExpEmpty < DefaultSymbolType > {}, regexp::FormalRegExpEpsilon < DefaultSymbolType > {})))); regexp::RegExp re = regexp::RegExpConcatenate::concatenate(re1, re2); @@ -45,7 +45,7 @@ void RegExpConcatenateTest::testRegExpConcatenate() { CPPUNIT_ASSERT(re == rer); } { - regexp::RegExp re1(regexp::FormalRegExp < > (regexp::FormalRegExpStructure < alphabet::Symbol > (regexp::FormalRegExpConcatenation < alphabet::Symbol > (regexp::FormalRegExpEmpty < alphabet::Symbol > {}, regexp::FormalRegExpEpsilon < alphabet::Symbol > {})))); + regexp::RegExp re1(regexp::FormalRegExp < > (regexp::FormalRegExpStructure < DefaultSymbolType > (regexp::FormalRegExpConcatenation < DefaultSymbolType > (regexp::FormalRegExpEmpty < DefaultSymbolType > {}, regexp::FormalRegExpEpsilon < DefaultSymbolType > {})))); std::string input2 = "(#E a b)"; regexp::RegExp re2 = alib::StringDataFactory::fromString<regexp::RegExp>(input2); diff --git a/alib2algo/test-src/regexp/transform/RegExpDerivationTest.cpp b/alib2algo/test-src/regexp/transform/RegExpDerivationTest.cpp index 84beecdfe04d09085cb76889263100035a430ce1..e45ed7a8038036b6cc0d00fd382753e4db7a0a8b 100644 --- a/alib2algo/test-src/regexp/transform/RegExpDerivationTest.cpp +++ b/alib2algo/test-src/regexp/transform/RegExpDerivationTest.cpp @@ -4,6 +4,7 @@ #include <string/String.h> #include <factory/StringDataFactory.hpp> +#include "factory/XmlDataFactory.hpp" #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) @@ -32,9 +33,15 @@ void RegExpDerivationTest::testRegExpDerivation() { } void RegExpDerivationTest::ExecSingleTest(std::string regexp_str, std::string string_str, std::string result) { - regexp::RegExp regexp = alib::StringDataFactory::fromString<regexp::RegExp>(regexp_str); + regexp::RegExp regexp0 = alib::StringDataFactory::fromString<regexp::RegExp>(regexp_str); + std::deque<sax::Token> tokens = alib::XmlDataFactory::toTokens(regexp0); + regexp::RegExp regexp = alib::XmlDataFactory::fromTokens<regexp::RegExp>(std::move(tokens)); - string::LinearString < > string = static_cast<const string::LinearString < >&>(alib::StringDataFactory::fromString<string::String>("\"" + string_str + "\"").getData()); + string::String string0 = alib::StringDataFactory::fromString<string::String>("\"" + string_str + "\""); + std::deque<sax::Token> tokens2 = alib::XmlDataFactory::toTokens(string0); + string::String string1 = alib::XmlDataFactory::fromTokens<string::String>(std::move(tokens2)); + + string::LinearString < > string = static_cast<const string::LinearString < >&>(string1.getData()); std::cout << alib::StringDataFactory::toString<regexp::RegExp>(regexp::RegExpDerivation::derivation(regexp, string)) << " == " << std::endl << result << std::endl << std::endl;