forked from boostorg/regex
Fix \R when no_escapes_in_list flag is set.
Fixes: https://github.com/boostorg/regex/issues/57
This commit is contained in:
@ -194,5 +194,23 @@ void test_assertion_escapes()
|
||||
TEST_REGEX_SEARCH("\\>", perl, "-", match_not_bow, make_array(-2, -2));
|
||||
TEST_REGEX_SEARCH("\\>", perl, "-", match_not_eow, make_array(-2, -2));
|
||||
TEST_REGEX_SEARCH("\\>", perl, "-", match_not_bow | match_not_eow, make_array(-2, -2));
|
||||
// Bug report https://github.com/boostorg/regex/issues/57
|
||||
// Line ending \R:
|
||||
TEST_REGEX_SEARCH("\\R", perl | no_escape_in_lists, "foo\nbar", match_default, make_array(3, 4, -2, -2));
|
||||
TEST_REGEX_SEARCH("\\R", perl | no_escape_in_lists, "foo\rbar", match_default, make_array(3, 4, -2, -2));
|
||||
TEST_REGEX_SEARCH("\\R", perl | no_escape_in_lists, "foo\r\nbar", match_default, make_array(3, 5, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\r\nbar", match_default, make_array(0, 5, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\012bar", match_default, make_array(0, 4, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\013bar", match_default, make_array(0, 4, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\013bar", match_default, make_array(0, 4, -2, -2));
|
||||
TEST_REGEX_SEARCH("(?x) abc \\R", perl | no_escape_in_lists, "abc\205bar", match_default, make_array(0, 4, -2, -2));
|
||||
// see if \u works:
|
||||
if(*w == 0x2028u)
|
||||
{
|
||||
TEST_REGEX_SEARCH_W(L"\\R", perl | no_escape_in_lists, L"foo\u2028bar", match_default, make_array(3, 4, -2, -2));
|
||||
TEST_REGEX_SEARCH_W(L"\\R", perl | no_escape_in_lists, L"foo\u2029bar", match_default, make_array(3, 4, -2, -2));
|
||||
TEST_REGEX_SEARCH_W(L"(?x) abc \\R", perl | no_escape_in_lists, L"abc\u2028bar", match_default, make_array(0, 4, -2, -2));
|
||||
TEST_REGEX_SEARCH_W(L"(?x) abc \\R", perl | no_escape_in_lists, L"abc\u2029bar", match_default, make_array(0, 4, -2, -2));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user