cvs: php4 /ext/mbstring/tests 002.inc 003.inc 004.inc 005.inc 006.inc 006.phpt 008.inc 009.inc 010.inc 010.phpt 011.inc 012.inc 013.inc 014.inc
014.phpt 015.inc 016.inc 017.inc 018.inc 019.inc 019.phpt
| From: | Rui Hirokawa | Date: | Sat, 16 Mar 2002 07:33:22 +0000 |
| Subject: | cvs: php4 /ext/mbstring/tests 002.inc 003.inc 004.inc 005.inc 006.inc 006.phpt 008.inc 009.inc 010.inc 010.phpt 011.inc 012.inc 013.inc 014.inc 014.phpt 015.inc 016.inc 017.inc 018.inc 019.inc 019.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10213@lists.php.net to get a copy of this message | ||
hirokawa Sat Mar 16 02:33:22 2002 EDT
Modified files:
/php4/ext/mbstring/tests 002.inc 003.inc 004.inc 005.inc 006.inc
006.phpt 008.inc 009.inc 010.inc 010.phpt
011.inc 012.inc 013.inc 014.inc 014.phpt
015.inc 016.inc 017.inc 018.inc 019.inc
019.phpt
Log:
fixed some errors of mbstring in regression tests.
Index: php4/ext/mbstring/tests/002.inc diff -u php4/ext/mbstring/tests/002.inc:1.2 php4/ext/mbstring/tests/002.inc:1.3 --- php4/ext/mbstring/tests/002.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/002.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $r = mb_internal_encoding('EUC-JP'); Index: php4/ext/mbstring/tests/003.inc diff -u php4/ext/mbstring/tests/003.inc:1.2 php4/ext/mbstring/tests/003.inc:1.3 --- php4/ext/mbstring/tests/003.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/003.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: This is not a real test.... Need to change so that it does real testing //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); $ini = ini_get('mbstring.http_input'); Index: php4/ext/mbstring/tests/004.inc diff -u php4/ext/mbstring/tests/004.inc:1.2 php4/ext/mbstring/tests/004.inc:1.3 --- php4/ext/mbstring/tests/004.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/004.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ //TODO: Add more encoding. Wrong paramter type test. //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Set HTTP output encoding to ASCII $r = mb_http_output('ASCII'); Index: php4/ext/mbstring/tests/005.inc diff -u php4/ext/mbstring/tests/005.inc:1.2 php4/ext/mbstring/tests/005.inc:1.3 --- php4/ext/mbstring/tests/005.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/005.inc Sat Mar 16 02:33:21 2002 @@ -1,7 +1,7 @@ <?php //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Set order to "auto" Index: php4/ext/mbstring/tests/006.inc diff -u php4/ext/mbstring/tests/006.inc:1.2 php4/ext/mbstring/tests/006.inc:1.3 --- php4/ext/mbstring/tests/006.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/006.inc Sat Mar 16 02:33:21 2002 @@ -1,7 +1,7 @@ <?php //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Note: It does not return TRUE/FALSE for setting char @@ -28,6 +28,5 @@ print "== INVALID PARAMETER ==\n"; $r = mb_substitute_character('BAD_NAME'); ($r === FALSE) ? print "OK_BAD_NAME\n" : print("NG_BAD_NAME: ".gettype($r)." $r\n"); -print mb_substitute_character() . "\n"; ?> Index: php4/ext/mbstring/tests/006.phpt diff -u php4/ext/mbstring/tests/006.phpt:1.1 php4/ext/mbstring/tests/006.phpt:1.2 --- php4/ext/mbstring/tests/006.phpt:1.1 Sat Mar 2 05:44:57 2002 +++ php4/ext/mbstring/tests/006.phpt Sat Mar 16 02:33:21 2002 @@ -14,6 +14,6 @@ OK_NONE none == INVALID PARAMETER == -ERR: +ERR: Warning OK_BAD_NAME Index: php4/ext/mbstring/tests/008.inc diff -u php4/ext/mbstring/tests/008.inc:1.2 php4/ext/mbstring/tests/008.inc:1.3 --- php4/ext/mbstring/tests/008.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/008.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); $str = mb_preferred_mime_name('sjis-win'); Index: php4/ext/mbstring/tests/009.inc diff -u php4/ext/mbstring/tests/009.inc:1.2 php4/ext/mbstring/tests/009.inc:1.3 --- php4/ext/mbstring/tests/009.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/009.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // restore detect_order to 'auto' mb_detect_order('auto'); @@ -33,6 +33,7 @@ // JIS // Note: either convert_encoding or strlen has problem echo "== JIS ==\n"; +mb_internal_encoding('EUC-JP') or print("mb_internal_encoding() failed\n"); $jis = mb_convert_encoding($euc_jp, 'JIS'); print mb_strlen($jis,'JIS') . "\n"; mb_internal_encoding('JIS') or print("mb_internal_encoding() failed\n"); @@ -41,6 +42,7 @@ // UTF-8 // Note: either convert_encoding or strlen has problem echo "== UTF-8 ==\n"; +mb_internal_encoding('EUC-JP') or print("mb_internal_encoding() failed\n"); $utf8 = mb_convert_encoding($euc_jp, 'UTF-8'); print mb_strlen($utf8,'UTF-8') . "\n"; mb_internal_encoding('UTF-8') or print("mb_internal_encoding() failed\n"); Index: php4/ext/mbstring/tests/010.inc diff -u php4/ext/mbstring/tests/010.inc:1.2 php4/ext/mbstring/tests/010.inc:1.3 --- php4/ext/mbstring/tests/010.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/010.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Test string @@ -26,24 +26,32 @@ // Note: PHP Warning - offset is negative. // Note: For offset(-15). It does not return position of latter string. (ie the same result as -50) echo "== NEGATIVE OFFSET ==\n"; -print mb_strpos($euc_jp,'ÆüËܸì', -15, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, '0', -15, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, 3, -15, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, 0, -15, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp,'ÆüËܸì', -50, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, '0', -50, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, 3, -50, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, 0, -50, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp,'ÆüËܸì', -15, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, '0', -15, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, 3, -15, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, 0, -15, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp,'ÆüËܸì', -50, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, '0', -50, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, 3, -50, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, 0, -50, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; // Out of range - should return false print ("== OUT OF RANGE ==\n"); -$r = mb_strpos($euc_jp,'ÆüËܸì', 40, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp,'ÆüËܸì', 40, 'EUC-JP'); ($r === FALSE) ? print "OK_OUT_RANGE\n" : print "NG_OUT_RANGE\n"; -$r = mb_strpos($euc_jp, '0', 40, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp, '0', 40, 'EUC-JP'); ($r === FALSE) ? print "OK_OUT_RANGE\n" : print "NG_OUT_RANGE\n"; -$r = mb_strpos($euc_jp, 3, 40, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp, 3, 40, 'EUC-JP'); ($r === FALSE) ? print "OK_OUT_RANGE\n" : print "NG_OUT_RANGE\n"; -$r = mb_strpos($euc_jp, 0, 40, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp, 0, 40, 'EUC-JP'); ($r === FALSE) ? print "OK_OUT_RANGE\n" : print "NG_OUT_RANGE\n"; // Note: Returned NULL string // echo gettype($r). ' val '. $r ."\n"; Index: php4/ext/mbstring/tests/010.phpt diff -u php4/ext/mbstring/tests/010.phpt:1.1 php4/ext/mbstring/tests/010.phpt:1.2 --- php4/ext/mbstring/tests/010.phpt:1.1 Sat Mar 2 05:44:57 2002 +++ php4/ext/mbstring/tests/010.phpt Sat Mar 16 02:33:21 2002 @@ -17,14 +17,22 @@ 33 30 == NEGATIVE OFFSET == -34 -30 -33 -30 -10 -0 -3 -0 +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET == OUT OF RANGE == OK_OUT_RANGE OK_OUT_RANGE Index: php4/ext/mbstring/tests/011.inc diff -u php4/ext/mbstring/tests/011.inc:1.2 php4/ext/mbstring/tests/011.inc:1.3 --- php4/ext/mbstring/tests/011.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/011.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Test string Index: php4/ext/mbstring/tests/012.inc diff -u php4/ext/mbstring/tests/012.inc:1.2 php4/ext/mbstring/tests/012.inc:1.3 --- php4/ext/mbstring/tests/012.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/012.inc Sat Mar 16 02:33:21 2002 @@ -1,7 +1,7 @@ <?php // TODO: Add more encodings ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $euc_jp = '0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£'; Index: php4/ext/mbstring/tests/013.inc diff -u php4/ext/mbstring/tests/013.inc:1.2 php4/ext/mbstring/tests/013.inc:1.3 --- php4/ext/mbstring/tests/013.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/013.inc Sat Mar 16 02:33:21 2002 @@ -1,7 +1,7 @@ <?php // TODO: Add more encodings ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $euc_jp = '0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£'; Index: php4/ext/mbstring/tests/014.inc diff -u php4/ext/mbstring/tests/014.inc:1.2 php4/ext/mbstring/tests/014.inc:1.3 --- php4/ext/mbstring/tests/014.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/014.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more encoding //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $euc_jp = '0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£'; @@ -11,12 +11,13 @@ print "2: ". mb_strimwidth($euc_jp, 0, 100,'...','EUC-JP') . "\n"; print "3: ". mb_strimwidth($euc_jp, 15, 100,'...','EUC-JP') . "\n"; // Note: Did not start form -22 offset. Staring from 0. -print "4: ". mb_strimwidth($euc_jp,-22, 100,'...','EUC-JP') . "\n"; +$str = mb_strimwidth($euc_jp,-22, 100,'...','EUC-JP'); +($str === FALSE) ? print "4 OK\n" : print "NG: $str\n"; $str = mb_strimwidth($euc_jp, 100, -10,'...','EUC-JP'); -($str === "") ? print "5 OK\n" : print "NG: $str\n"; +($str === FALSE) ? print "5 OK\n" : print "NG: $str\n"; $str = mb_strimwidth($euc_jp, -100, 10,'...','EUC-JP'); -($str !== "") ? print "6 OK: $str\n" : print "NG: $str\n"; +($str === FALSE) ? print "6 OK\n" : print "NG: $str\n"; ?> Index: php4/ext/mbstring/tests/014.phpt diff -u php4/ext/mbstring/tests/014.phpt:1.1 php4/ext/mbstring/tests/014.phpt:1.2 --- php4/ext/mbstring/tests/014.phpt:1.1 Sat Mar 2 05:44:57 2002 +++ php4/ext/mbstring/tests/014.phpt Sat Mar 16 02:33:21 2002 @@ -10,8 +10,11 @@ 1: 0123¤³¤Îʸ»ú... 2: 0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£ 3: ¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£ -4: EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£ +ERR: Warning +4 OK +ERR: Warning 5 OK -6 OK: 0123¤³... +ERR: Warning +6 OK Index: php4/ext/mbstring/tests/015.inc diff -u php4/ext/mbstring/tests/015.inc:1.2 php4/ext/mbstring/tests/015.inc:1.3 --- php4/ext/mbstring/tests/015.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/015.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more tests //$debug = true; // Uncomment this line to view error/warning/notice message in *.out file ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // SJIS string (BASE64 encoded) $sjis = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg=='); Index: php4/ext/mbstring/tests/016.inc diff -u php4/ext/mbstring/tests/016.inc:1.2 php4/ext/mbstring/tests/016.inc:1.3 --- php4/ext/mbstring/tests/016.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/016.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more tests //$debug = true; // Uncomment this line to view error/warning/notice message in *.out file ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // SJIS string (BASE64 encoded) $sjis = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg=='); @@ -35,8 +35,7 @@ // Using Encoding List Array echo "== ARRAY ENCODING LIST ==\n"; -$a = array(0=>'UTF-8',1=>'EUC-JP', 2=>'SJIS', 3=>'JIS'); - +$a = array(0=>'JIS', 1=>'UTF-8', 2=>'EUC-JP', 3=>'SJIS'); $s = $jis; $s = mb_convert_encoding($s, 'EUC-JP', $a); print("EUC-JP: $s\n"); // EUC-JP @@ -53,19 +52,16 @@ // Using Detect Order echo "== DETECT ORDER ==\n"; -mb_detect_order('auto'); - - $s = $jis; -$s = mb_convert_encoding($s, 'EUC-JP'); +$s = mb_convert_encoding($s, 'EUC-JP', 'auto'); print("EUC-JP: $s\n"); // EUC-JP $s = $euc_jp; -$s = mb_convert_encoding($s, 'SJIS'); +$s = mb_convert_encoding($s, 'SJIS', 'auto'); print("SJIS: ".base64_encode($s)."\n"); // SJIS $s = $euc_jp; -$s = mb_convert_encoding($s, 'JIS'); +$s = mb_convert_encoding($s, 'JIS', 'auto'); print("JIS: ".base64_encode($s)."\n"); // JIS Index: php4/ext/mbstring/tests/017.inc diff -u php4/ext/mbstring/tests/017.inc:1.2 php4/ext/mbstring/tests/017.inc:1.3 --- php4/ext/mbstring/tests/017.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/017.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more tests //$debug = true; // Uncomment this line to view error/warning/notice message in *.out file ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // SJIS string (BASE64 encoded) $sjis = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg=='); Index: php4/ext/mbstring/tests/018.inc diff -u php4/ext/mbstring/tests/018.inc:1.2 php4/ext/mbstring/tests/018.inc:1.3 --- php4/ext/mbstring/tests/018.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/018.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more encoding, strings..... //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $euc_jp = '0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£'; Index: php4/ext/mbstring/tests/019.inc diff -u php4/ext/mbstring/tests/019.inc:1.2 php4/ext/mbstring/tests/019.inc:1.3 --- php4/ext/mbstring/tests/019.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/019.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // restore detect_order to 'auto' mb_detect_order('auto'); Index: php4/ext/mbstring/tests/019.phpt diff -u php4/ext/mbstring/tests/019.phpt:1.2 php4/ext/mbstring/tests/019.phpt:1.3 --- php4/ext/mbstring/tests/019.phpt:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/019.phpt Sat Mar 16 02:33:21 2002 @@ -1,5 +1,5 @@ --TEST-- -mb_strlen() +strlen() --SKIPIF-- <?php include('skipif.inc'); ?> --POST--
Index: php4/ext/mbstring/tests/002.inc diff -u php4/ext/mbstring/tests/002.inc:1.2 php4/ext/mbstring/tests/002.inc:1.3 --- php4/ext/mbstring/tests/002.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/002.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $r = mb_internal_encoding('EUC-JP'); Index: php4/ext/mbstring/tests/003.inc diff -u php4/ext/mbstring/tests/003.inc:1.2 php4/ext/mbstring/tests/003.inc:1.3 --- php4/ext/mbstring/tests/003.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/003.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: This is not a real test.... Need to change so that it does real testing //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); $ini = ini_get('mbstring.http_input'); Index: php4/ext/mbstring/tests/004.inc diff -u php4/ext/mbstring/tests/004.inc:1.2 php4/ext/mbstring/tests/004.inc:1.3 --- php4/ext/mbstring/tests/004.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/004.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ //TODO: Add more encoding. Wrong paramter type test. //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Set HTTP output encoding to ASCII $r = mb_http_output('ASCII'); Index: php4/ext/mbstring/tests/005.inc diff -u php4/ext/mbstring/tests/005.inc:1.2 php4/ext/mbstring/tests/005.inc:1.3 --- php4/ext/mbstring/tests/005.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/005.inc Sat Mar 16 02:33:21 2002 @@ -1,7 +1,7 @@ <?php //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Set order to "auto" Index: php4/ext/mbstring/tests/006.inc diff -u php4/ext/mbstring/tests/006.inc:1.2 php4/ext/mbstring/tests/006.inc:1.3 --- php4/ext/mbstring/tests/006.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/006.inc Sat Mar 16 02:33:21 2002 @@ -1,7 +1,7 @@ <?php //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Note: It does not return TRUE/FALSE for setting char @@ -28,6 +28,5 @@ print "== INVALID PARAMETER ==\n"; $r = mb_substitute_character('BAD_NAME'); ($r === FALSE) ? print "OK_BAD_NAME\n" : print("NG_BAD_NAME: ".gettype($r)." $r\n"); -print mb_substitute_character() . "\n"; ?> Index: php4/ext/mbstring/tests/006.phpt diff -u php4/ext/mbstring/tests/006.phpt:1.1 php4/ext/mbstring/tests/006.phpt:1.2 --- php4/ext/mbstring/tests/006.phpt:1.1 Sat Mar 2 05:44:57 2002 +++ php4/ext/mbstring/tests/006.phpt Sat Mar 16 02:33:21 2002 @@ -14,6 +14,6 @@ OK_NONE none == INVALID PARAMETER == -ERR: +ERR: Warning OK_BAD_NAME Index: php4/ext/mbstring/tests/008.inc diff -u php4/ext/mbstring/tests/008.inc:1.2 php4/ext/mbstring/tests/008.inc:1.3 --- php4/ext/mbstring/tests/008.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/008.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); $str = mb_preferred_mime_name('sjis-win'); Index: php4/ext/mbstring/tests/009.inc diff -u php4/ext/mbstring/tests/009.inc:1.2 php4/ext/mbstring/tests/009.inc:1.3 --- php4/ext/mbstring/tests/009.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/009.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // restore detect_order to 'auto' mb_detect_order('auto'); @@ -33,6 +33,7 @@ // JIS // Note: either convert_encoding or strlen has problem echo "== JIS ==\n"; +mb_internal_encoding('EUC-JP') or print("mb_internal_encoding() failed\n"); $jis = mb_convert_encoding($euc_jp, 'JIS'); print mb_strlen($jis,'JIS') . "\n"; mb_internal_encoding('JIS') or print("mb_internal_encoding() failed\n"); @@ -41,6 +42,7 @@ // UTF-8 // Note: either convert_encoding or strlen has problem echo "== UTF-8 ==\n"; +mb_internal_encoding('EUC-JP') or print("mb_internal_encoding() failed\n"); $utf8 = mb_convert_encoding($euc_jp, 'UTF-8'); print mb_strlen($utf8,'UTF-8') . "\n"; mb_internal_encoding('UTF-8') or print("mb_internal_encoding() failed\n"); Index: php4/ext/mbstring/tests/010.inc diff -u php4/ext/mbstring/tests/010.inc:1.2 php4/ext/mbstring/tests/010.inc:1.3 --- php4/ext/mbstring/tests/010.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/010.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Test string @@ -26,24 +26,32 @@ // Note: PHP Warning - offset is negative. // Note: For offset(-15). It does not return position of latter string. (ie the same result as -50) echo "== NEGATIVE OFFSET ==\n"; -print mb_strpos($euc_jp,'ÆüËܸì', -15, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, '0', -15, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, 3, -15, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, 0, -15, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp,'ÆüËܸì', -50, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, '0', -50, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, 3, -50, 'EUC-JP') . "\n"; -print mb_strpos($euc_jp, 0, -50, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp,'ÆüËܸì', -15, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, '0', -15, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, 3, -15, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, 0, -15, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp,'ÆüËܸì', -50, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, '0', -50, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, 3, -50, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; +$r = mb_strpos($euc_jp, 0, -50, 'EUC-JP'); +($r === FALSE) ? print "OK_NEGATIVE_OFFSET\n" : print "NG_NEGATIVE_OFFSET\n"; // Out of range - should return false print ("== OUT OF RANGE ==\n"); -$r = mb_strpos($euc_jp,'ÆüËܸì', 40, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp,'ÆüËܸì', 40, 'EUC-JP'); ($r === FALSE) ? print "OK_OUT_RANGE\n" : print "NG_OUT_RANGE\n"; -$r = mb_strpos($euc_jp, '0', 40, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp, '0', 40, 'EUC-JP'); ($r === FALSE) ? print "OK_OUT_RANGE\n" : print "NG_OUT_RANGE\n"; -$r = mb_strpos($euc_jp, 3, 40, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp, 3, 40, 'EUC-JP'); ($r === FALSE) ? print "OK_OUT_RANGE\n" : print "NG_OUT_RANGE\n"; -$r = mb_strpos($euc_jp, 0, 40, 'EUC-JP') . "\n"; +$r = mb_strpos($euc_jp, 0, 40, 'EUC-JP'); ($r === FALSE) ? print "OK_OUT_RANGE\n" : print "NG_OUT_RANGE\n"; // Note: Returned NULL string // echo gettype($r). ' val '. $r ."\n"; Index: php4/ext/mbstring/tests/010.phpt diff -u php4/ext/mbstring/tests/010.phpt:1.1 php4/ext/mbstring/tests/010.phpt:1.2 --- php4/ext/mbstring/tests/010.phpt:1.1 Sat Mar 2 05:44:57 2002 +++ php4/ext/mbstring/tests/010.phpt Sat Mar 16 02:33:21 2002 @@ -17,14 +17,22 @@ 33 30 == NEGATIVE OFFSET == -34 -30 -33 -30 -10 -0 -3 -0 +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET +ERR: Warning +OK_NEGATIVE_OFFSET == OUT OF RANGE == OK_OUT_RANGE OK_OUT_RANGE Index: php4/ext/mbstring/tests/011.inc diff -u php4/ext/mbstring/tests/011.inc:1.2 php4/ext/mbstring/tests/011.inc:1.3 --- php4/ext/mbstring/tests/011.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/011.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // Test string Index: php4/ext/mbstring/tests/012.inc diff -u php4/ext/mbstring/tests/012.inc:1.2 php4/ext/mbstring/tests/012.inc:1.3 --- php4/ext/mbstring/tests/012.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/012.inc Sat Mar 16 02:33:21 2002 @@ -1,7 +1,7 @@ <?php // TODO: Add more encodings ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $euc_jp = '0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£'; Index: php4/ext/mbstring/tests/013.inc diff -u php4/ext/mbstring/tests/013.inc:1.2 php4/ext/mbstring/tests/013.inc:1.3 --- php4/ext/mbstring/tests/013.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/013.inc Sat Mar 16 02:33:21 2002 @@ -1,7 +1,7 @@ <?php // TODO: Add more encodings ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $euc_jp = '0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£'; Index: php4/ext/mbstring/tests/014.inc diff -u php4/ext/mbstring/tests/014.inc:1.2 php4/ext/mbstring/tests/014.inc:1.3 --- php4/ext/mbstring/tests/014.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/014.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more encoding //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $euc_jp = '0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£'; @@ -11,12 +11,13 @@ print "2: ". mb_strimwidth($euc_jp, 0, 100,'...','EUC-JP') . "\n"; print "3: ". mb_strimwidth($euc_jp, 15, 100,'...','EUC-JP') . "\n"; // Note: Did not start form -22 offset. Staring from 0. -print "4: ". mb_strimwidth($euc_jp,-22, 100,'...','EUC-JP') . "\n"; +$str = mb_strimwidth($euc_jp,-22, 100,'...','EUC-JP'); +($str === FALSE) ? print "4 OK\n" : print "NG: $str\n"; $str = mb_strimwidth($euc_jp, 100, -10,'...','EUC-JP'); -($str === "") ? print "5 OK\n" : print "NG: $str\n"; +($str === FALSE) ? print "5 OK\n" : print "NG: $str\n"; $str = mb_strimwidth($euc_jp, -100, 10,'...','EUC-JP'); -($str !== "") ? print "6 OK: $str\n" : print "NG: $str\n"; +($str === FALSE) ? print "6 OK\n" : print "NG: $str\n"; ?> Index: php4/ext/mbstring/tests/014.phpt diff -u php4/ext/mbstring/tests/014.phpt:1.1 php4/ext/mbstring/tests/014.phpt:1.2 --- php4/ext/mbstring/tests/014.phpt:1.1 Sat Mar 2 05:44:57 2002 +++ php4/ext/mbstring/tests/014.phpt Sat Mar 16 02:33:21 2002 @@ -10,8 +10,11 @@ 1: 0123¤³¤Îʸ»ú... 2: 0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£ 3: ¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£ -4: EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£ +ERR: Warning +4 OK +ERR: Warning 5 OK -6 OK: 0123¤³... +ERR: Warning +6 OK Index: php4/ext/mbstring/tests/015.inc diff -u php4/ext/mbstring/tests/015.inc:1.2 php4/ext/mbstring/tests/015.inc:1.3 --- php4/ext/mbstring/tests/015.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/015.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more tests //$debug = true; // Uncomment this line to view error/warning/notice message in *.out file ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // SJIS string (BASE64 encoded) $sjis = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg=='); Index: php4/ext/mbstring/tests/016.inc diff -u php4/ext/mbstring/tests/016.inc:1.2 php4/ext/mbstring/tests/016.inc:1.3 --- php4/ext/mbstring/tests/016.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/016.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more tests //$debug = true; // Uncomment this line to view error/warning/notice message in *.out file ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // SJIS string (BASE64 encoded) $sjis = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg=='); @@ -35,8 +35,7 @@ // Using Encoding List Array echo "== ARRAY ENCODING LIST ==\n"; -$a = array(0=>'UTF-8',1=>'EUC-JP', 2=>'SJIS', 3=>'JIS'); - +$a = array(0=>'JIS', 1=>'UTF-8', 2=>'EUC-JP', 3=>'SJIS'); $s = $jis; $s = mb_convert_encoding($s, 'EUC-JP', $a); print("EUC-JP: $s\n"); // EUC-JP @@ -53,19 +52,16 @@ // Using Detect Order echo "== DETECT ORDER ==\n"; -mb_detect_order('auto'); - - $s = $jis; -$s = mb_convert_encoding($s, 'EUC-JP'); +$s = mb_convert_encoding($s, 'EUC-JP', 'auto'); print("EUC-JP: $s\n"); // EUC-JP $s = $euc_jp; -$s = mb_convert_encoding($s, 'SJIS'); +$s = mb_convert_encoding($s, 'SJIS', 'auto'); print("SJIS: ".base64_encode($s)."\n"); // SJIS $s = $euc_jp; -$s = mb_convert_encoding($s, 'JIS'); +$s = mb_convert_encoding($s, 'JIS', 'auto'); print("JIS: ".base64_encode($s)."\n"); // JIS Index: php4/ext/mbstring/tests/017.inc diff -u php4/ext/mbstring/tests/017.inc:1.2 php4/ext/mbstring/tests/017.inc:1.3 --- php4/ext/mbstring/tests/017.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/017.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more tests //$debug = true; // Uncomment this line to view error/warning/notice message in *.out file ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // SJIS string (BASE64 encoded) $sjis = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg=='); Index: php4/ext/mbstring/tests/018.inc diff -u php4/ext/mbstring/tests/018.inc:1.2 php4/ext/mbstring/tests/018.inc:1.3 --- php4/ext/mbstring/tests/018.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/018.inc Sat Mar 16 02:33:21 2002 @@ -2,7 +2,7 @@ // TODO: Add more encoding, strings..... //$debug = true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // EUC-JP $euc_jp = '0123¤³¤Îʸ»úÎó¤ÏÆüËܸì¤Ç¤¹¡£EUC-JP¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£ÆüËܸì¤ÏÌÌÅݽ¤¤¡£'; Index: php4/ext/mbstring/tests/019.inc diff -u php4/ext/mbstring/tests/019.inc:1.2 php4/ext/mbstring/tests/019.inc:1.3 --- php4/ext/mbstring/tests/019.inc:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/019.inc Sat Mar 16 02:33:21 2002 @@ -3,7 +3,7 @@ //$debug=true; ini_set('include_path','.'); -include_once('common.inc'); +include_once('common.php'); // restore detect_order to 'auto' mb_detect_order('auto'); Index: php4/ext/mbstring/tests/019.phpt diff -u php4/ext/mbstring/tests/019.phpt:1.2 php4/ext/mbstring/tests/019.phpt:1.3 --- php4/ext/mbstring/tests/019.phpt:1.2 Thu Mar 7 03:06:22 2002 +++ php4/ext/mbstring/tests/019.phpt Sat Mar 16 02:33:21 2002 @@ -1,5 +1,5 @@ --TEST-- -mb_strlen() +strlen() --SKIPIF-- <?php include('skipif.inc'); ?> --POST--