Annotation of embedaddon/php/ext/mbstring/tests/mb_strcut.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: mb_strcut()
! 3: --SKIPIF--
! 4: <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
! 5: --INI--
! 6: output_handler=
! 7: --FILE--
! 8: <?php
! 9: // TODO: Add more encodings
! 10: ini_set('include_path', dirname(__FILE__));
! 11: include_once('common.inc');
! 12:
! 13: // EUC-JP
! 14: $euc_jp = '0123この文字列は日本語です。EUC-JPを使っています。日本語は面倒臭い。';
! 15:
! 16: print mb_strcut($euc_jp, 6, 5,'EUC-JP') . "\n";
! 17: print mb_strcut($euc_jp, 0, 100,'EUC-JP') . "\n";
! 18:
! 19: $str = mb_strcut($euc_jp, 100, 10,'EUC-JP');
! 20: ($str === false) ? print "OK\n" : print "NG: $str\n";
! 21:
! 22: $str = mb_strcut($euc_jp, -100, 10,'EUC-JP');
! 23: ($str !== "") ? print "OK: $str\n" : print "NG:\n";
! 24:
! 25:
! 26: ?>
! 27:
! 28: --EXPECT--
! 29: の文
! 30: 0123この文字列は日本語です。EUC-JPを使っています。日本語は面倒臭い。
! 31: OK
! 32: OK: 0123この文
! 33:
! 34:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>