Re: Re: run-tests.php
| From: | Zoe Slattery | Date: | Fri, 14 Sep 2007 12:53:25 +0000 |
| Subject: | Re: Re: run-tests.php | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals php.qa |
| Request: | Send a blank email to internals+get-32319@lists.php.net to get a copy of this message | ||
Hi again
On second thoughts - cancel my last two notes - yours is a better fix. :-)
Zoe
Johannes Schlüter wrote:
Hi Nuno, On Thu, 2007-09-13 at 20:20 +0100, Nuno Lopes wrote:Should be http://web.ist.utl.pt/nuno.lopes/php_run_tests_%25s.txt I guess ;-)OK, so basically it is impossible to fix the current regex to match what we want (I had a quick chat with the PCRE author and he thinks the same). I propose the following patch: http://web.ist.utl.pt/nuno.lopes/php_run_tests_%s.txtnow i get the issue. It grabbs more than one line! This means run-tests.php has to be fixed. The whole thing is designed under the assumption that %s catches no new lines and hence only one line.That would be the best answer but I think it's a difficult fix and whatever it was might break other tests. I think it would mean replacing %s with something other than .+?. I'll have a look tomorrow and see if I can find a regex that would do - one of the things that had me confused for a while was that I thought the ? (non-greedy qualifier) should guarentee the minimum match but it doesn't work quite like that.The main changes are: '%s' => '[^\r\n]+' '%a' => '.+' This means that some tests have to be fixed, but the majority passes. Most important is that with this patch I found some tests that had the expected output wrong. So unless someone rejects this patch, I'll commit it (and update the http://qa.php.net/write-test.php page too). Anyway, I don't think that a function name should be replaced by %s. The expected output should be as stricter as possible.from a short review of the patch I think it's fine and a good idea. So please go on and commit. johannes