forked from boostorg/regex
Added Perl-5.10 "branch reset" support.
[SVN r52961]
This commit is contained in:
@ -40,7 +40,6 @@ int error_count = 0;
|
||||
|
||||
void run_tests()
|
||||
{
|
||||
RUN_TESTS(test_pocessive_repeats);
|
||||
RUN_TESTS(basic_tests);
|
||||
RUN_TESTS(test_simple_repeats);
|
||||
RUN_TESTS(test_alt);
|
||||
@ -71,6 +70,8 @@ void run_tests()
|
||||
RUN_TESTS(test_operators);
|
||||
RUN_TESTS(test_overloads);
|
||||
RUN_TESTS(test_unicode);
|
||||
RUN_TESTS(test_pocessive_repeats);
|
||||
RUN_TESTS(test_mark_resets);
|
||||
}
|
||||
|
||||
int cpp_main(int /*argc*/, char * /*argv*/[])
|
||||
|
@ -259,5 +259,6 @@ void test_operators();
|
||||
void test_overloads();
|
||||
void test_unicode();
|
||||
void test_pocessive_repeats();
|
||||
void test_mark_resets();
|
||||
|
||||
#endif
|
||||
|
@ -651,3 +651,28 @@ void test_options3()
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_mark_resets()
|
||||
{
|
||||
using namespace boost::regex_constants;
|
||||
|
||||
TEST_REGEX_SEARCH("(?|(abc)|(xyz))", perl, "abc", match_default, make_array(0, 3, 0, 3, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?|(abc)|(xyz))", perl, "xyz", match_default, make_array(0, 3, 0, 3, -2, -2));
|
||||
TEST_REGEX_SEARCH("(x)(?|(abc)|(xyz))(x)", perl, "xabcx", match_default, make_array(0, 5, 0, 1, 1, 4, 4, 5, -2, -2));
|
||||
TEST_REGEX_SEARCH("(x)(?|(abc)|(xyz))(x)", perl, "xxyzx", match_default, make_array(0, 5, 0, 1, 1, 4, 4, 5, -2, -2));
|
||||
TEST_REGEX_SEARCH("(x)(?|(abc)(pqr)|(xyz))(x)", perl, "xabcpqrx", match_default, make_array(0, 8, 0, 1, 1, 4, 4, 7, 7, 8, -2, -2));
|
||||
TEST_REGEX_SEARCH("(x)(?|(abc)(pqr)|(xyz))(x)", perl, "xxyzx", match_default, make_array(0, 5, 0, 1, 1, 4, -1, -1, 4, 5, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?|(abc)|(xyz))\\1", perl, "abcabc", match_default, make_array(0, 6, 0, 3, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?|(abc)|(xyz))\\1", perl, "xyzxyz", match_default, make_array(0, 6, 0, 3, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?|(abc)|(xyz))\\1", perl, "abcxyz", match_default, make_array(-2, -2));
|
||||
TEST_REGEX_SEARCH("(?|(abc)|(xyz))\\1", perl, "xyzabc", match_default, make_array(-2, -2));
|
||||
//TEST_REGEX_SEARCH("(?|(abc)|(xyz))(?1)", perl, "abcabc", match_default, make_array(0, 6, 0, 3, -2, -2));
|
||||
//TEST_REGEX_SEARCH("(?|(abc)|(xyz))(?1)", perl, "xyzabc", match_default, make_array(0, 6, 0, 3, -2, -2));
|
||||
//TEST_REGEX_SEARCH("(?|(abc)|(xyz))(?1)", perl, "xyzxyz", match_default, make_array(-2, -2));
|
||||
//TEST_REGEX_SEARCH("^X(?5)(a)(?|(b)|(q))(c)(d)(Y)", perl, "XYabcdY", match_default, make_array(0, 7, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, -2, -2));
|
||||
//TEST_INVALID_REGEX("^X(?5)(a)(?|(b)|(q))(c)(d)Y", perl);
|
||||
//TEST_REGEX_SEARCH("^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)", perl, "XYabcdY", match_default, make_array(0, 7, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, -2, -2));
|
||||
//TEST_REGEX_SEARCH("^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)", perl, "XYabcdY", match_default, make_array(0, 7, 2, 3, 3, 4, -1, -1, -1, -1, 6, 7, -2, -2));
|
||||
//TEST_REGEX_SEARCH("^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)", perl, "XYabcdY", match_default, make_array(0, 7, 2, 3, 3, 4, -1, -1, -1, -1, 6, 7, -2, -2));
|
||||
//TEST_REGEX_SEARCH("^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)", perl, "XYabcdY", match_default, make_array(0, 7, 2, 3, 3, 4, -1, -1, -1, -1, 6, 7, -2, -2));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user