--EXPECTF-- section comparison is broken #56

Open
opened 2026-01-24 11:40:34 +01:00 by admin · 1 comment
Owner

Originally created by @cmb69 on GitHub (Oct 16, 2019).

Consider the following PHPT:

--TEST--
oops
--FILE--
<?php
echo "foo";
?>
--EXPECTF--
bar

This is certainly supposed to fail (outputs foo but expects bar), but with current HEAD it passes for me. I did some improvements to make the internally generated regex more strict (replaced the .* at the beginning and end with ^ and $, respectively), but the test still passed. I've quickly rewritten the relevant parts using java.util.regex instead of our port of org.apache.regexp and then the test failed.

Originally created by @cmb69 on GitHub (Oct 16, 2019). Consider the following PHPT: ```` --TEST-- oops --FILE-- <?php echo "foo"; ?> --EXPECTF-- bar ```` This is certainly supposed to fail (outputs `foo` but expects `bar`), but with current HEAD it passes for me. I did some improvements to make the internally generated regex more strict (replaced the `.*` at the beginning and end with `^` and `$`, respectively), but the test still passed. I've quickly rewritten the relevant parts using java.util.regex instead of our port of org.apache.regexp and then the test failed.
admin added the bug label 2026-01-24 11:40:34 +01:00
Author
Owner

@cmb69 commented on GitHub (Oct 22, 2019):

FTR: php-test-pack-7.3.11 has 16224 tests; 7257 use EXPECTF and 75 use EXPECTREGEX.

@cmb69 commented on GitHub (Oct 22, 2019): FTR: php-test-pack-7.3.11 has 16224 tests; 7257 use EXPECTF and 75 use EXPECTREGEX.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: php/pftt2#56