Re: UEXPECTF is gone: any way to write "portable" tests?
| From: | Ulf Wendel | Date: | Wed, 23 Jul 2008 15:37:02 +0000 |
| Subject: | Re: UEXPECTF is gone: any way to write "portable" tests? | ||
| References: | 1 2 3 4 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64395@lists.php.net to get a copy of this message | ||
Lars Strojny schrieb:
Am Mittwoch, den 23.07.2008, 14:27 +0200 schrieb Ulf Wendel:Should be as little as inserting the following two lines into run-tests.phpt at line 1711 (HEAD): $wanted_re = str_replace('%string|unicode%', (version_compare(PHP_VERSION, '6.0.0-dev') == -1) ? 'string' : 'unicode', $wanted_re); $wanted_re = str_replace('%unicode|string%', (version_compare(PHP_VERSION, '6.0.0-dev') == -1) ? 'string' : 'unicode', $wanted_re); Usage as demonstrated in the two tests for tests/run-test/: http://ulf-wendel.de/test011.phpt http://ulf-wendel.de/test012.phpt UlfI did not like that as it does match both string(3) "PHP" and unicode(3) "PHP": no way to detect a bug. As long as "%string/unicode%" gets evaluated as "unicode" under PHP 6 and as "string" under PHP 5, I'm fine with the change.OK, fine. I have currently no time implementing it, do you?