Source for file utf8_position.test.php
Documentation is available at utf8_position.test.php
* @version $Id: utf8_position.test.php,v 1.1 2007/09/09 20:39:50 pitlinz Exp $
//--------------------------------------------------------------------
require_once(dirname(__FILE__
).
'/../config.php');
require_once UTF8 .
'/utils/position.php';
//--------------------------------------------------------------------
$str =
'Iñtërnâtiônàlizætiøn';
// tests for utf8_locate_current_chr & utf8_locate_next_chr
// single byte, should return current index
$tests[] =
array('aaживπά우리をあöä',0,0);
$tests[] =
array('aaживπά우리をあöä',1,1);
foreach($tests as $test){
$tests[] =
array('aaживπά우리をあöä',1,1);
foreach($tests as $test){
// two byte, should move to boundary, expect even number
$tests[] =
array('aaживπά우리をあöä',2,2);
$tests[] =
array('aaживπά우리をあöä',3,2);
$tests[] =
array('aaживπά우리をあöä',4,4);
foreach($tests as $test){
$tests[] =
array('aaживπά우리をあöä',2,2);
$tests[] =
array('aaживπά우리をあöä',3,4);
$tests[] =
array('aaживπά우리をあöä',4,4);
foreach($tests as $test){
// three byte, should move to boundary 10 or 13
$tests[] =
array('aaживπά우리をあöä',10,10);
$tests[] =
array('aaживπά우리をあöä',11,10);
$tests[] =
array('aaживπά우리をあöä',12,10);
$tests[] =
array('aaживπά우리をあöä',13,13);
foreach($tests as $test){
$tests[] =
array('aaживπά우리をあöä',10,10);
$tests[] =
array('aaживπά우리をあöä',11,13);
$tests[] =
array('aaживπά우리をあöä',12,13);
$tests[] =
array('aaживπά우리をあöä',13,13);
foreach($tests as $test){
$tests[] =
array('aaживπά우리をあöä',-
2,0);
$tests[] =
array('aaживπά우리をあöä',128,29);
foreach($tests as $test){
$tests[] =
array('aaживπά우리をあöä',-
2,0);
$tests[] =
array('aaживπά우리をあöä',128,29);
foreach($tests as $test){
//--------------------------------------------------------------------
Documentation generated on Thu, 08 Jan 2009 17:49:16 +0100 by phpDocumentor 1.4.0a2