From c55d09c2f547634b577aa5aeaa1438d772bc29d1 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 29 Nov 2019 16:47:10 +0100 Subject: [PATCH] Adapt test cases for Oniguruma 6.9.4 Apparently, bug 78633 has now really been fixed; the former fix only catered to the buffer overflow, but yielded a wrong result. Also, the order of the named captures has been fixed. --- ext/mbstring/tests/bug78633.phpt | 9 ++++-- ...> mb_ereg_search_named_subpatterns_1.phpt} | 1 + .../mb_ereg_search_named_subpatterns_2.phpt | 32 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) rename ext/mbstring/tests/{mb_ereg_search_named_subpatterns.phpt => mb_ereg_search_named_subpatterns_1.phpt} (87%) create mode 100644 ext/mbstring/tests/mb_ereg_search_named_subpatterns_2.phpt diff --git a/ext/mbstring/tests/bug78633.phpt b/ext/mbstring/tests/bug78633.phpt index 3ff69a1867..a1d6dd5602 100644 --- a/ext/mbstring/tests/bug78633.phpt +++ b/ext/mbstring/tests/bug78633.phpt @@ -7,7 +7,12 @@ if (!function_exists('mb_eregi')) die('skip mb_eregi function not available'); ?> --FILE-- --EXPECT-- -bool(false) +ok diff --git a/ext/mbstring/tests/mb_ereg_search_named_subpatterns.phpt b/ext/mbstring/tests/mb_ereg_search_named_subpatterns_1.phpt similarity index 87% rename from ext/mbstring/tests/mb_ereg_search_named_subpatterns.phpt rename to ext/mbstring/tests/mb_ereg_search_named_subpatterns_1.phpt index f899e9beeb..f6ab8c0c36 100644 --- a/ext/mbstring/tests/mb_ereg_search_named_subpatterns.phpt +++ b/ext/mbstring/tests/mb_ereg_search_named_subpatterns_1.phpt @@ -4,6 +4,7 @@ Testing mb_ereg_search() named capture groups --FILE-- =') or die("skip requires oniguruma >= 6.9.4"); +?> +--FILE-- +\s*)(?\w+)(?[?!])'); + var_dump(mb_ereg_search_getregs()); +?> +--EXPECT-- +array(7) { + [0]=> + string(11) " 中国?" + [1]=> + string(2) " " + [2]=> + string(6) "中国" + [3]=> + string(3) "?" + ["wsp"]=> + string(2) " " + ["word"]=> + string(6) "中国" + ["punct"]=> + string(3) "?" +} -- 2.40.0