Contribution: Tests for MBString Extension
| From: | Josie Messa | Date: | Fri, 01 Feb 2008 10:37:25 +0000 |
| Subject: | Contribution: Tests for MBString Extension | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-62382@lists.php.net to get a copy of this message | ||
Hi,
I've written some PHPT tests for the MBString functions that I'd like to
contribute. They've been tested on the most recent PHP5.2/PHP5.3/PHP6
snapshot builds on both Linux and Windows. You can get them here:
http://www.robtrew.net/jmessa/
N.B:
I have raised a number of bugs related to these test cases. For the 5.2
and 5.3 tests I have removed the code or test that shows the bugs so that
the tests will still pass where possible, but the PHP 6 tests are
written to pass only once the bugs are fixed so they will fail with the
code the way it is now. . Below are the tests where this applies:
- mb_ereg_variation1.phpt - mb_ereg 'successfully' matches strings where
it shouldn't, bug here: http://bugs.php.net/bug.php?id=43994
I have removed the code that shows this bug in my 5.2 and 5.3
tests but not the PHP 6 test.
- mb_ereg_basic.phpt - mb_ereg returns a byte length of matched string
instead of character length, bug here:
http://bugs.php.net/bug.php?id=43995
for all versions I have left in this bug, but on PHP 6 the
expected output is that which would be produced with the bug fixed.
- mb_regex_encoding_variaton2.phpt (PHP6 test only) - encodings listed for
mbstring do not work with all functions, bug here:
http://bugs.php.net/bug.php?id=44000
- mb_strpos_variation5.phpt (PHP6 test only) - mb_strpos bounds check is
byte count for negative values, bug here:
http://bugs.php.net/bug.php?id=43840
- mb_strrpos_variation5.phpt (PHP6 test only) - mb_strrpos offset is byte
count rather than character count, bug here:
http://bugs.php.net/bug.php?id=43841
- mb_substr_count_variation4.phpt (PHP6 test only) - mb_substr_count
behaves different to substr_count with overlapping needles, bug here:
http://bugs.php.net/bug.php?id=43993
- mb_strto[upper|lower]_variation2.phpt and
mb_strto[upper|lower]_error2.phpt - two error messages returned for
incorrect/unknown encoding, bug here: http://bugs.php.net/bug.php?id=43998
These tests for all versions reflect the current behaviour of PHP
as I do not know which error message should be returned in what case.
I have written more test cases which I could contribute and will be
applying for a CVS ID for that reason.
Thanks,
Josie Messa
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU