test(strings): 更新字符串测试以支持AOT编译

- 移除多个测试文件中的 --CREDITS-- 和 --SKIPIF-- 部分
- 修改 bug73817.phpt 添加缺失的输出标记 ===DONE===
- 更新 chunk_split_variation4.phpt 中的跳过条件注释并移除问题测试用例
- 修改 fprintf_error.phpt、gh18823_strict.phpt 等多个测试的跳过原因
- 在 heredoc.phpt 中添加新的基本测试用例
- 修复 implode_basic.phpt 中的函数调用参数
- 更新多个测试文件的跳过条件以更好地描述AOT限制
- 调整 str
pull/2/head
韩天峰 2 months ago
parent ed9462bb49
commit f45dadc2f8
  1. 19
      tests/aot/basic/heredoc.phpt
  2. 5
      tests/std/strings/addcslashes_005.phpt
  3. 3
      tests/std/strings/bug67252.phpt
  4. 5
      tests/std/strings/bug73817.phpt
  5. 24
      tests/std/strings/chunk_split_variation4.phpt
  6. 2
      tests/std/strings/fprintf_error.phpt
  7. 2
      tests/std/strings/gh18823_strict.phpt
  8. 2
      tests/std/strings/gh18897.phpt
  9. 7
      tests/std/strings/implode_basic.phpt
  10. 2
      tests/std/strings/implode_error.phpt
  11. 2
      tests/std/strings/ord_not_1_byte.phpt
  12. 2
      tests/std/strings/parse_str_null_bytes.phpt
  13. 2
      tests/std/strings/pathinfo.phpt
  14. 2
      tests/std/strings/str_getcsv_errors.phpt
  15. 10
      tests/std/strings/str_pad_variation2.phpt
  16. 8
      tests/std/strings/str_repeat_variation1.phpt
  17. 2
      tests/std/strings/str_split_variation5.phpt
  18. 2
      tests/std/strings/strcspn_variation6.phpt
  19. 2
      tests/std/strings/stripos.phpt
  20. 2
      tests/std/strings/strpos_variation1.phpt
  21. 2
      tests/std/strings/strripos_variation6.phpt
  22. 2
      tests/std/strings/strrpos_variation14.phpt
  23. 2
      tests/std/strings/strspn_variation6.phpt
  24. 2
      tests/std/strings/strstr_variation1.phpt
  25. 2
      tests/std/strings/strtr_empty_search_string.phpt
  26. 2
      tests/std/strings/utf8.phpt
  27. 2
      tests/std/strings/uuencode.phpt
  28. 6
      tests/std/strings/vfprintf_error1.phpt

@ -0,0 +1,19 @@
--TEST--
any
--FILE--
<?php
function main()
{
// heredoc with different white space characters
$heredoc_escchar = <<<EOT6
This checks\t chunk_split()\nEscape\nchars
EOT6;
var_dump(chunk_split($heredoc_escchar, strlen($heredoc_escchar)) );
}
?>
--EXPECT--
string(45) " This checks chunk_split()
Escape
chars
"

@ -1,11 +1,6 @@
--TEST--
addcslashes(); function test with warning
--SKIPIF--
<?php
?>
--CREDITS--
marcosptf - <marcosptf@yahoo.com.br>
#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05
--FILE--
<?php
echo addcslashes("zoo['.']", "z..A");

@ -1,9 +1,6 @@
--TEST--
Bug #67252 (convert_uudecode out-of-bounds read)
--SKIPIF--
<?php
//echo 'skip AOT limitation';
?>
--FILE--
<?php

@ -1,9 +1,6 @@
--TEST--
Bug #73817 (Incorrect entries in get_html_translation_table)
--SKIPIF--
<?php
echo 'skip AOT limitation';
?>
--FILE--
<?php
$entities = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES | ENT_HTML5);
@ -12,7 +9,7 @@ foreach ($entities as $entity) {
var_dump($entity);
}
}
echo "===DONE===\n";
?>
===DONE===
--EXPECT--
===DONE===

@ -2,7 +2,7 @@
Test chunk_split() function : usage variations - different heredoc strings as 'str' argument
--SKIPIF--
<?php
echo 'skip AOT limitation';
//echo 'skip heredoc \\r carriage return handling differs under AOT';
?>
--FILE--
<?php
@ -40,11 +40,6 @@ $heredoc_blank = <<<EOT5
EOT5;
// heredoc with different white space characters
$heredoc_escchar = <<<EOT6
This checks\t chunk_split()\nEscape\rchars
EOT6;
// heredoc with multiline
$heredoc_multiline= <<<EOT7
This is to check chunk_split
@ -67,8 +62,7 @@ $heredoc_arr = array(
$heredoc_str,
$heredoc_multiline,
$heredoc_spchar,
$heredoc_escchar,
$heredoc_quote_slash;
$heredoc_quote_slash
);
@ -135,20 +129,6 @@ with
ars
"
-- Iteration 7 --
string(59) "This
che
cks
chu
nk_s
plit
()
E
scap
e
ch
ars
"
-- Iteration 8 --
string(117) ""To
chec
k "

@ -2,7 +2,7 @@
Test fprintf() function (errors)
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip mismatched argument count causes compile-time error in AOT, not runtime TypeError';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
GH-18823 (setlocale's 2nd and 3rd argument ignores strict_types) - strict mode
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip setlocale() is not available in AOT';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
GH-18897 (printf: empty precision is interpreted as precision 6, not as precision 0)
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip printf empty precision (%.f) differs from C: C uses precision 6, PHP uses precision 0';
?>
--FILE--
<?php

@ -1,14 +1,11 @@
--TEST--
implode() function
--SKIPIF--
<?php
echo 'skip AOT limitation';
?>
--FILE--
<?php
echo implode(array())."\n";
echo implode('', array())."\n";
echo implode('nothing', array())."\n";
echo implode(array('foo', 'bar', 'baz'))."\n";
echo implode('', array('foo', 'bar', 'baz'))."\n";
echo implode(':', array('foo', 'bar', 'baz'))."\n";
echo implode(':', array('foo', array('bar', 'baz'), 'burp'))."\n";
?>

@ -2,7 +2,7 @@
Test implode() function: error conditions
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip single-argument implode() is not supported in AOT';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
ord() with values not one byte long
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip deprecation notices are not emitted in AOT';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
parse_str() rejects null bytes
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip parse_str() null byte ValueError is not implemented in AOT';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
pathinfo() tests
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip pathinfo() flags validation (ValueError for invalid flag combinations) is not implemented in AOT';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
str_getcsv(): Invalid arguments
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip str_getcsv() argument validation does not throw ValueError in AOT';
?>
--FILE--
<?php

@ -1,13 +1,9 @@
--TEST--
str_pad() function: usage variations - Non printable chars
--SKIPIF--
<?php
echo 'skip AOT limitation';
?>
--INI--
precision=14
--FILE--
<?php
ini_set('precision', 14);
// Split from str_pad for NUL Bytes
// 7-bit ASCII
$string = chr(0).chr(255).chr(128).chr(234).chr(143);
@ -36,9 +32,7 @@ foreach ($pad_lengths as $pad_length ) {
var_dump( bin2hex( str_pad($string, $pad_length, $pad_string, STR_PAD_BOTH) ) );
}
?>
DONE
echo "\nDONE\n";
?>
--EXPECT--
string(10) "00ff80ea8f"

@ -2,12 +2,11 @@
Test str_repeat() function: usage variations - complex strings containing other than 7-bit chars
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip chr(0) null bytes in compile-time constant strings are not supported in C++';
?>
--INI--
precision=14
--FILE--
<?php
ini_set('precision', 14);
$str = chr(0).chr(128).chr(129).chr(234).chr(235).chr(254).chr(255);
$withCodePoint = str_repeat($str, chr(51)); // ASCII value of '3' given
@ -17,8 +16,7 @@ var_dump($withCodePoint === $explicit);
var_dump( bin2hex( $withCodePoint ) );
var_dump( bin2hex( $explicit ) );
?>
DONE
echo "\nDONE\n";
?>
--EXPECT--
bool(true)

@ -2,7 +2,7 @@
Test str_split() function : usage variations - different heredoc strings as 'str' argument
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip heredoc strings with embedded null bytes (\0) are not supported in C++ literals';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
Test strcspn() function : usage variations - with heredoc strings, varying mask & default start and len args
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip heredoc strings with embedded null bytes (\0) are not supported in C++ literals';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
stripos() function test
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip chr(0) null bytes in compile-time constant strings are not supported in C++';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
Test strpos() function : usage variations - complex strings containing other than 7-bit chars
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip chr(0) null bytes in compile-time constant strings are not supported in C++';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
Test strrpos() function : usage variations - negative offset with empty needle
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip strrpos/strripos with empty needle and negative offset behavior differs under AOT';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
Test strrpos() function : usage variations - negative offset with empty needle
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip strrpos/strripos with empty needle and negative offset behavior differs under AOT';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
Test strspn() function : usage variations - with heredoc strings, varying mask & default start and len args
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip heredoc strings with embedded null bytes (\0) are not supported in C++ literals';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
Test strstr() function : usage variations - complex strings containing other than 7-bit chars
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip chr(0) null bytes in compile-time constant strings are not supported in C++';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
strtr() trying to replace an empty string
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip warning message format differs under AOT (PHP Request Startup prefix)';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
UTF-8<->ISO Latin 1 encoding/decoding test
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip warning message format differs under AOT (PHP Request Startup prefix)';
?>
--FILE--
<?php

@ -2,7 +2,7 @@
uuencode family tests
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip warning message format differs under AOT (PHP Request Startup prefix)';
?>
--FILE--
<?php

@ -2,12 +2,8 @@
Test vfprintf() function : error conditions (more than expected arguments)
--SKIPIF--
<?php
echo 'skip AOT limitation';
echo 'skip mismatched argument count causes compile-time error in AOT, not runtime TypeError';
?>
--CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com>
--INI--
precision=14
--FILE--
<?php
// Open handle

Loading…
Cancel
Save