Committing failing tests?

php.internals

Zoe Slattery

19 years ago
Hi I have some updates that I'd like to make to ext/tests/standard/array/range.phpt, the updates work fine with unicode.semantics=off but not with unicode.semantics=on. The problem seems to be that the warning Notices that are generated are different with unicode on. This doesn't look like intentional behaviour but I'm guessing it might well be something that isn't implemented yet. So, my question is - is it reasonable/helpful to add a test in CVS that I know will fail if it's in an area that is currently under development? Zoe Slattery IBM UK

Derick Rethans

19 years ago
On Tue, 15 May 2007, Zoe Slattery wrote:
> I have some updates that I'd like to make to > ext/tests/standard/array/range.phpt, the updates work fine with > unicode.semantics=off but not with unicode.semantics=on. The problem seems to > be that the warning Notices that are generated are different with unicode on. > This doesn't look like intentional behaviour but I'm guessing it might well be > something that isn't implemented yet. > > So, my question is - is it reasonable/helpful to add a test in CVS that I know > will fail if it's in an area that is currently under development?
I would say that it's a good idea to commit those if you are certain that the "unicode" behavior is wrong. In other cases I suggest to write a mail to internals about it. regards, Derick
-- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

Zoe Slattery

19 years ago
Derick Rethans wrote:
> On Tue, 15 May 2007, Zoe Slattery wrote: > > >> I have some updates that I'd like to make to >> ext/tests/standard/array/range.phpt, the updates work fine with >> unicode.semantics=off but not with unicode.semantics=on. The problem seems to >> be that the warning Notices that are generated are different with unicode on. >> This doesn't look like intentional behaviour but I'm guessing it might well be >> something that isn't implemented yet. >> >> So, my question is - is it reasonable/helpful to add a test in CVS that I know >> will fail if it's in an area that is currently under development? >> > > I would say that it's a good idea to commit those if you are certain > that the "unicode" behavior is wrong. In other cases I suggest to write > a mail to internals about it. >
I've looked at this a bit more and have absolutely no idea whether the behaviour that I get is expected or not, it is certainly different. So, here is a very cutdown test case that shows the difference. Note that it's not intended to do anything sensible - I've just pulled it out of a larger test caes that executes range() with all sorts of input. This passes fine on PHP6 with unicode.semantics=off. --TEST-- PHP6 unicode Notices different --FILE-- <?php $low_arr = "ABCD"; $high_arr = array(1,2); echo "\n-- creating an array with low = '$low_arr' and high = '$high_arr' --\n"; var_dump( range( $low_arr, $high_arr ) ); --EXPECTF-- -- creating an array with low = 'ABCD' and high = 'Array' -- Notice: Array to string conversion in %s on line %d array(1) { [0]=> string(1) "A" } --UEXPECTF-- -- creating an array with low = 'ABCD' and high = 'Array' -- Notice: Array to string conversion in %s on line %d array(1) { [0]=> unicode(1) "A" } Here is the actual output on PHP6 Notice: Array to string conversion in /home/zoe/TESTS/range/ztest.php on line 5 -- creating an array with low = 'ABCD' and high = 'Array' -- Notice: Array to string conversion in /home/zoe/TESTS/range/ztest.php on line 6 array(1) { [0]=> unicode(1) "A" } So. with unicode.semantics=on an additional Notice is generated which appears to be caused by the echo statment. Any ideas?

Antony Dovgal

19 years ago
On 05/15/2007 10:46 PM, Zoe Slattery wrote:
> So. with unicode.semantics=on an additional Notice is generated which > appears to be caused by the echo statment. Any ideas?
Yes, I'll look into it a bit later.
-- Wbr, Antony Dovgal

Antony Dovgal

19 years ago
Fixed, thanks for the heads up. On 15.05.2007 22:46, Zoe Slattery wrote:
> --TEST-- > PHP6 unicode Notices different > --FILE-- > <?php > $low_arr = "ABCD"; > $high_arr = array(1,2); > > echo "\n-- creating an array with low = '$low_arr' and high = > '$high_arr' --\n"; > var_dump( range( $low_arr, $high_arr ) ); > > --EXPECTF-- > > -- creating an array with low = 'ABCD' and high = 'Array' -- > > Notice: Array to string conversion in %s on line %d > array(1) { > [0]=> > string(1) "A" > } > --UEXPECTF-- > > -- creating an array with low = 'ABCD' and high = 'Array' -- > > Notice: Array to string conversion in %s on line %d > array(1) { > [0]=> > unicode(1) "A" > } > > Here is the actual output on PHP6 > > Notice: Array to string conversion in /home/zoe/TESTS/range/ztest.php on > line 5 > > -- creating an array with low = 'ABCD' and high = 'Array' -- > > Notice: Array to string conversion in /home/zoe/TESTS/range/ztest.php on > line 6 > array(1) { > [0]=> > unicode(1) "A" > } > > So. with unicode.semantics=on an additional Notice is generated which > appears to be caused by the echo statment. Any ideas?
-- Wbr, Antony Dovgal

Marcus Börger

19 years ago
Hello Zoe, I did the same with a certain case in SPL. The result was that any test run of 5.2.1 had failures on that test while as HEAD did not have it anymore. The thing is that I used it to remind myself that i have to merge the fix and to anybody else that this is not working correct yet. In this case however you need to keep track of changes in the area because sometimes the actual fix chnages the resulting output a bit from the original expectation. So you should stay in touch with the actual developer, of course at least informing him of the error. best regards marcus Tuesday, May 15, 2007, 5:42:40 PM, you wrote:
> Hi
> I have some updates that I'd like to make to > ext/tests/standard/array/range.phpt, the updates work fine with > unicode.semantics=off but not with unicode.semantics=on. The problem > seems to be that the warning Notices that are generated are different > with unicode on. This doesn't look like intentional behaviour but I'm > guessing it might well be something that isn't implemented yet.
> So, my question is - is it reasonable/helpful to add a test in CVS that > I know will fail if it's in an area that is currently under development?
> Zoe Slattery > IBM UK
Best regards, Marcus

Antony Dovgal

19 years ago
On 05/15/2007 07:42 PM, Zoe Slattery wrote:
> Hi > > I have some updates that I'd like to make to > ext/tests/standard/array/range.phpt, the updates work fine with > unicode.semantics=off but not with unicode.semantics=on. The problem > seems to be that the warning Notices that are generated are different > with unicode on. This doesn't look like intentional behaviour but I'm > guessing it might well be something that isn't implemented yet. > > So, my question is - is it reasonable/helpful to add a test in CVS that > I know will fail if it's in an area that is currently under development?
Definitely yes.
-- Wbr, Antony Dovgal