diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-06-21 16:02:35 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-06-21 16:02:35 +0200 |
commit | 1592fbd332373a110edcc28468cd8dc2b99271ef (patch) | |
tree | ea55441a8d982b7f1593d7fb00f0db7d63924381 /pcre/pcre_jit_test.c | |
parent | e7591a1ba94f404a87e65554298574bfa97020f2 (diff) | |
download | mariadb-git-1592fbd332373a110edcc28468cd8dc2b99271ef.tar.gz |
8.39
Diffstat (limited to 'pcre/pcre_jit_test.c')
-rw-r--r-- | pcre/pcre_jit_test.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/pcre/pcre_jit_test.c b/pcre/pcre_jit_test.c index 17378957d62..9b61ec000fa 100644 --- a/pcre/pcre_jit_test.c +++ b/pcre/pcre_jit_test.c @@ -242,13 +242,17 @@ static struct regression_test_case regression_test_cases[] = { { MA, 0, "a\\z", "aaa" }, { MA, 0 | F_NOMATCH, "a\\z", "aab" }, - /* Brackets. */ + /* Brackets and alternatives. */ { MUA, 0, "(ab|bb|cd)", "bacde" }, { MUA, 0, "(?:ab|a)(bc|c)", "ababc" }, { MUA, 0, "((ab|(cc))|(bb)|(?:cd|efg))", "abac" }, { CMUA, 0, "((aB|(Cc))|(bB)|(?:cd|EFg))", "AcCe" }, { MUA, 0, "((ab|(cc))|(bb)|(?:cd|ebg))", "acebebg" }, { MUA, 0, "(?:(a)|(?:b))(cc|(?:d|e))(a|b)k", "accabdbbccbk" }, + { MUA, 0, "\xc7\x82|\xc6\x82", "\xf1\x83\x82\x82\xc7\x82\xc7\x83" }, + { MUA, 0, "=\xc7\x82|#\xc6\x82", "\xf1\x83\x82\x82=\xc7\x82\xc7\x83" }, + { MUA, 0, "\xc7\x82\xc7\x83|\xc6\x82\xc6\x82", "\xf1\x83\x82\x82\xc7\x82\xc7\x83" }, + { MUA, 0, "\xc6\x82\xc6\x82|\xc7\x83\xc7\x83|\xc8\x84\xc8\x84", "\xf1\x83\x82\x82\xc8\x84\xc8\x84" }, /* Greedy and non-greedy ? operators. */ { MUA, 0, "(?:a)?a", "laab" }, @@ -318,6 +322,14 @@ static struct regression_test_case regression_test_cases[] = { { CMUA, 0, "[^\xe1\xbd\xb8][^\xc3\xa9]", "\xe1\xbd\xb8\xe1\xbf\xb8\xc3\xa9\xc3\x89#" }, { MUA, 0, "[^\xe1\xbd\xb8][^\xc3\xa9]", "\xe1\xbd\xb8\xe1\xbf\xb8\xc3\xa9\xc3\x89#" }, { MUA, 0, "[^\xe1\xbd\xb8]{3,}?", "##\xe1\xbd\xb8#\xe1\xbd\xb8#\xc3\x89#\xe1\xbd\xb8" }, + { MUA, 0, "\\d+123", "987654321,01234" }, + { MUA, 0, "abcd*|\\w+xy", "aaaaa,abxyz" }, + { MUA, 0, "(?:abc|((?:amc|\\b\\w*xy)))", "aaaaa,abxyz" }, + { MUA, 0, "a(?R)|([a-z]++)#", ".abcd.abcd#."}, + { MUA, 0, "a(?R)|([a-z]++)#", ".abcd.mbcd#."}, + { MUA, 0, ".[ab]*.", "xx" }, + { MUA, 0, ".[ab]*a", "xxa" }, + { MUA, 0, ".[ab]?.", "xx" }, /* Bracket repeats with limit. */ { MUA, 0, "(?:(ab){2}){5}M", "abababababababababababM" }, @@ -574,6 +586,16 @@ static struct regression_test_case regression_test_cases[] = { { MUA, 0, "(?:(?=.)??[a-c])+m", "abacdcbacacdcaccam" }, { MUA, 0, "((?!a)?(?!([^a]))?)+$", "acbab" }, { MUA, 0, "((?!a)?\?(?!([^a]))?\?)+$", "acbab" }, + { MUA, 0, "a(?=(?C)\\B)b", "ab" }, + { MUA, 0, "a(?!(?C)\\B)bb|ab", "abb" }, + { MUA, 0, "a(?=\\b|(?C)\\B)b", "ab" }, + { MUA, 0, "a(?!\\b|(?C)\\B)bb|ab", "abb" }, + { MUA, 0, "c(?(?=(?C)\\B)ab|a)", "cab" }, + { MUA, 0, "c(?(?!(?C)\\B)ab|a)", "cab" }, + { MUA, 0, "c(?(?=\\b|(?C)\\B)ab|a)", "cab" }, + { MUA, 0, "c(?(?!\\b|(?C)\\B)ab|a)", "cab" }, + { MUA, 0, "a(?=)b", "ab" }, + { MUA, 0 | F_NOMATCH, "a(?!)b", "ab" }, /* Not empty, ACCEPT, FAIL */ { MUA | PCRE_NOTEMPTY, 0 | F_NOMATCH, "a*", "bcx" }, @@ -664,6 +686,7 @@ static struct regression_test_case regression_test_cases[] = { { PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 1, ".", "\r\n" }, { PCRE_FIRSTLINE | PCRE_NEWLINE_LF | PCRE_DOTALL, 0 | F_NOMATCH, "ab.", "ab" }, { MUA | PCRE_FIRSTLINE, 1 | F_NOMATCH, "^[a-d0-9]", "\nxx\nd" }, + { PCRE_NEWLINE_ANY | PCRE_FIRSTLINE | PCRE_DOTALL, 0, "....a", "012\n0a" }, /* Recurse. */ { MUA, 0, "(a)(?1)", "aa" }, @@ -798,6 +821,9 @@ static struct regression_test_case regression_test_cases[] = { /* (*SKIP) verb. */ { MUA, 0 | F_NOMATCH, "(?=a(*SKIP)b)ab|ad", "ad" }, + { MUA, 0, "(\\w+(*SKIP)#)", "abcd,xyz#," }, + { MUA, 0, "\\w+(*SKIP)#|mm", "abcd,xyz#," }, + { MUA, 0 | F_NOMATCH, "b+(?<=(*SKIP)#c)|b+", "#bbb" }, /* (*THEN) verb. */ { MUA, 0, "((?:a(*THEN)|aab)(*THEN)c|a+)+m", "aabcaabcaabcaabcnacm" }, @@ -1534,10 +1560,10 @@ static int regression_tests(void) is_successful = 0; } #endif -#if defined SUPPORT_PCRE16 && defined SUPPORT_PCRE16 - if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector16_1[i] || ovector16_1[i] != ovector16_2[i]) { - printf("\n16 and 16 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n", - i, ovector16_1[i], ovector16_2[i], ovector16_1[i], ovector16_2[i], +#if defined SUPPORT_PCRE16 && defined SUPPORT_PCRE32 + if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector32_1[i] || ovector16_1[i] != ovector32_2[i]) { + printf("\n16 and 32 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n", + i, ovector16_1[i], ovector16_2[i], ovector32_1[i], ovector32_2[i], total, current->pattern, current->input); is_successful = 0; } |