# Committing failing tests?

- Thread: https://externals.io/message/29440
- Original archive: https://news-web.php.net/php.internals/29440
- Started by Zoe Slattery on 2007-05-15T15:42:40+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #29440 — Zoe Slattery — 2007-05-15T15:42:40+00:00

URL: https://externals.io/message/29440#29440

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

---

## #29441 — Derick Rethans — 2007-05-15T15:49:58+00:00

URL: https://externals.io/message/29440#29441 · In reply to: #29440

> 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

---

## #29442 — Marcus Boerger — 2007-05-15T16:07:11+00:00

URL: https://externals.io/message/29440#29442 · In reply to: #29440

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

---

## #29446 — Antony Dovgal — 2007-05-15T17:39:04+00:00

URL: https://externals.io/message/29440#29446 · In reply to: #29440

> 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

---

## #29448 — Zoe Slattery — 2007-05-15T18:46:15+00:00

URL: https://externals.io/message/29440#29448 · In reply to: #29441

Derick Rethans wrote:
> 
>
>   
> > […]
>
> 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?

> regards,
> Derick

---

## #29450 — Antony Dovgal — 2007-05-15T18:59:02+00:00

URL: https://externals.io/message/29440#29450 · In reply to: #29448

> 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

---

## #29494 — Antony Dovgal — 2007-05-17T17:34:42+00:00

URL: https://externals.io/message/29440#29494 · In reply to: #29448

Fixed, thanks for the heads up.


> --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
