1
0
Fork 0

Prevent backtracking issues with long tests

pull/685/head
Jordi Boggiano 2012-05-13 22:36:32 +02:00
parent cd4cceaf7b
commit f7d5df2764
1 changed files with 6 additions and 5 deletions

View File

@ -196,13 +196,14 @@ class InstallerTest extends TestCase
$test = file_get_contents($file->getRealpath());
$content = '(?:.(?!--[A-Z]))+';
$pattern = '{^
--TEST--\s*(?P<test>.*?)\s*
(?:--CONDITION--\s*(?P<condition>.*?))?\s*
--COMPOSER--\s*(?P<composer>.*?)\s*
(?:--LOCK--\s*(?P<lock>.*?))?\s*
(?:--INSTALLED--\s*(?P<installed>.*?))?\s*
(?:--INSTALLED:DEV--\s*(?P<installedDev>.*?))?\s*
(?:--CONDITION--\s*(?P<condition>'.$content.'))?\s*
--COMPOSER--\s*(?P<composer>'.$content.')\s*
(?:--LOCK--\s*(?P<lock>'.$content.'))?\s*
(?:--INSTALLED--\s*(?P<installed>'.$content.'))?\s*
(?:--INSTALLED:DEV--\s*(?P<installedDev>'.$content.'))?\s*
--EXPECT(?P<update>:UPDATE)?(?P<dev>:DEV)?--\s*(?P<expect>.*?)\s*
$}xs';