From 4a941b70a7d6830ce2827d42f2fda844aa8dfc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 9 Jul 2022 20:31:55 +0200 Subject: [PATCH] Fix "%f" regex in run-tests.php "-.0.0" and "0." is no longer matched wrongly --- run-tests.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/run-tests.php b/run-tests.php index ff8fc1a09b148..a17afd957ace4 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2583,10 +2583,9 @@ function run_test(string $php, $file, array $env): string $wanted_re = str_replace('%i', '[+-]?\d+', $wanted_re); $wanted_re = str_replace('%d', '\d+', $wanted_re); $wanted_re = str_replace('%x', '[0-9a-fA-F]+', $wanted_re); - $wanted_re = str_replace('%f', '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $wanted_re); + $wanted_re = str_replace('%f', '[+-]?(?:\d+|(?=\.\d))(?:\.\d+)?(?:[Ee][+-]?\d+)?', $wanted_re); $wanted_re = str_replace('%c', '.', $wanted_re); $wanted_re = str_replace('%0', '\x00', $wanted_re); - // %f allows two points "-.0.0" but that is the best *simple* expression } if (preg_match("/^$wanted_re\$/s", $output)) {