diff options
author | chris <chris@jalakai.co.uk> | 2006-08-26 11:53:11 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-08-26 11:53:11 +0200 |
commit | 5953e88907368380d326c187b3d1071f575c7daf (patch) | |
tree | 97342e4fb4614370b7dca614196296e16e1c8c82 /_test | |
parent | 0eac1afbfcac819df65253478138374667f9b8df (diff) | |
download | rpg-5953e88907368380d326c187b3d1071f575c7daf.tar.gz rpg-5953e88907368380d326c187b3d1071f575c7daf.tar.bz2 |
ft_snippet() update, fix utf8 problems
darcs-hash:20060826095311-9b6ab-9a6f272cc7c7532eb2bad8f7b4404c5a16b71109.gz
Diffstat (limited to '_test')
-rw-r--r-- | _test/cases/inc/utf8_correctidx.test.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/_test/cases/inc/utf8_correctidx.test.php b/_test/cases/inc/utf8_correctidx.test.php new file mode 100644 index 000000000..1e7abf04a --- /dev/null +++ b/_test/cases/inc/utf8_correctidx.test.php @@ -0,0 +1,25 @@ +<?php +// use no mbstring help here +if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); +require_once DOKU_INC.'inc/utf8.php'; + +class utf8_correctidx_test extends UnitTestCase { + + + function test1(){ + // we test multiple cases here - format: in, offset, length, out + $tests = array(); + + $tests[] = array('живπά우리をあöä',1,false,0); + $tests[] = array('живπά우리をあöä',2,false,2); + $tests[] = array('живπά우리をあöä',1,true,2); + $tests[] = array('живπά우리をあöä',0,false,0); + $tests[] = array('живπά우리をあöä',2,true,2); + + foreach($tests as $test){ + $this->assertEqual(utf8_correctIdx($test[0],$test[1],$test[2]),$test[3]); + } + } + +} +//Setup VIM: ex: et ts=4 enc=utf-8 : |