Fix "%f" regex in run-tests.php (#8965)

"-.0.0" and "0." is no longer matched wrongly
This commit is contained in:
Michael Voříšek 2022-07-10 15:33:10 +02:00 committed by GitHub
parent d217a669fc
commit 6cd5bd1bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2583,10 +2583,9 @@ COMMAND $cmd
$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)) {