helly Mon Nov 4 05:43:22 2002 EDT Added files: /php4/tests/run-test test001.phpt test002.phpt test003.phpt test004.phpt test005.phpt test006.phpt test007.phpt
Removed files: /php4/tests dirname.phpt Log: -testing the tests -moved tests/dirname.phpt to tests/run-test/test007.phpt because many tests use this to find their additional files. -no more tests in tests directly only in subdirectories Index: php4/tests/run-test/test001.phpt +++ php4/tests/run-test/test001.phpt --TEST-- EXPECT --FILE-- abc --EXPECT-- abc Index: php4/tests/run-test/test002.phpt +++ php4/tests/run-test/test002.phpt --TEST-- EXPECTF --FILE-- 123 -123 +123 +1.1 abc 0abc x --EXPECTF-- %d %i %i %f %s %x %c Index: php4/tests/run-test/test003.phpt +++ php4/tests/run-test/test003.phpt --TEST-- EXPECTREGEX --FILE-- abcde12314235xyz34264768286abcde --EXPECTREGEX-- [abcde]+[0-5]*xyz[2-8]+abcde Index: php4/tests/run-test/test004.phpt +++ php4/tests/run-test/test004.phpt --TEST-- INI section allows '=' --INI-- arg_separator.input== --FILE-- <?php var_dump(ini_get('arg_separator.input')); ?> --EXPECT-- string(1) "=" Index: php4/tests/run-test/test005.phpt +++ php4/tests/run-test/test005.phpt --TEST-- Error message handling --FILE-- <?php // If this test fails ask the developers of run-test.php // // We check the general ini settings which affect error handling // and than verify if a message is given by a division by zero. // EXPECTF is used here since the error format may change but ut // should always contain 'Division by zero'. var_dump(ini_get('display_errors')); var_dump(ini_get('error_reporting')); var_dump(ini_get('log_errors')); var_dump(ini_get('track_errors')); ini_set('display_errors', 0); var_dump(ini_get('display_errors')); var_dump($php_errormsg); $error = 1 / 0; var_dump($php_errormsg); ?> --EXPECTF-- string(1) "1" string(4) "2047" string(1) "0" string(1) "1" string(1) "0" NULL string(%d) "%sivision by zer%s" Index: php4/tests/run-test/test006.phpt +++ php4/tests/run-test/test006.phpt --TEST-- Error messages are shown --FILE-- <?php // If this test fails ask the developers of run-test.php $error = 1 / 0; ?> --EXPECTREGEX-- *Division by zero.* Index: php4/tests/run-test/test007.phpt +++ php4/tests/run-test/test007.phpt --TEST-- dirname test --FILE-- <?php // Allow for either Win32 or Unix. $s = dirname("/foo"); // $s should be either / (Unix) or \ (Win32) function check_dirname($path) { global $s; $path1 = str_replace("%",$s,$path); $path2 = dirname($path1); $path3 = str_replace($s,"%",$path2); print "dirname($path) == $path3\n"; } check_dirname("%foo%"); check_dirname("%foo"); check_dirname("%foo%bar"); check_dirname("%"); check_dirname("...%foo"); check_dirname(".%foo"); check_dirname("foobar%%%"); function same($a,$b) { if ($a == $b) { print "OK\n"; } else { print "FAIL $a == $b\n"; } } if ('/' == $s) { same(".",dirname("d:\\foo\\bar.inc")); same(".",dirname("c:\\foo")); same(".",dirname("c:\\")); same(".",dirname("c:")); } else { same("d:\\foo",dirname("d:\\foo\\bar.inc")); same("c:\\",dirname("c:\\foo")); same("c:\\",dirname("c:\\")); same("c:",dirname("c:")); } ?> --EXPECT-- dirname(%foo%) == % dirname(%foo) == % dirname(%foo%bar) == %foo dirname(%) == % dirname(...%foo) == ... dirname(.%foo) == . dirname(foobar%%%) == . OK OK OK OK -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php