From f7d5df27641ab9da1759d54f66c9394c25ecd473 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 13 May 2012 22:36:32 +0200 Subject: [PATCH] Prevent backtracking issues with long tests --- tests/Composer/Test/InstallerTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index b6a809dc1..20a8c14cf 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -196,13 +196,14 @@ class InstallerTest extends TestCase $test = file_get_contents($file->getRealpath()); + $content = '(?:.(?!--[A-Z]))+'; $pattern = '{^ --TEST--\s*(?P.*?)\s* - (?:--CONDITION--\s*(?P.*?))?\s* - --COMPOSER--\s*(?P.*?)\s* - (?:--LOCK--\s*(?P.*?))?\s* - (?:--INSTALLED--\s*(?P.*?))?\s* - (?:--INSTALLED:DEV--\s*(?P.*?))?\s* + (?:--CONDITION--\s*(?P'.$content.'))?\s* + --COMPOSER--\s*(?P'.$content.')\s* + (?:--LOCK--\s*(?P'.$content.'))?\s* + (?:--INSTALLED--\s*(?P'.$content.'))?\s* + (?:--INSTALLED:DEV--\s*(?P'.$content.'))?\s* --EXPECT(?P:UPDATE)?(?P:DEV)?--\s*(?P.*?)\s* $}xs';