diff options
author | chris <chris@jalakai.co.uk> | 2006-08-31 11:21:46 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-08-31 11:21:46 +0200 |
commit | 0e70946d23660c4814db46cd3f89cb8340e51336 (patch) | |
tree | afe4516d890cb5e6192bda9584427b0af80c97fe /_test | |
parent | 9ee93076cf04a466d2e9620bc3efe538d93e5983 (diff) | |
download | rpg-0e70946d23660c4814db46cd3f89cb8340e51336.tar.gz rpg-0e70946d23660c4814db46cd3f89cb8340e51336.tar.bz2 |
add unittests for bug#891
darcs-hash:20060831092146-9b6ab-b00aa29c982ab18117f476b3d01d5111915c9d4b.gz
Diffstat (limited to '_test')
-rw-r--r-- | _test/cases/inc/utf8_substr.test.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/_test/cases/inc/utf8_substr.test.php b/_test/cases/inc/utf8_substr.test.php index 92bc65fe3..5cb93034a 100644 --- a/_test/cases/inc/utf8_substr.test.php +++ b/_test/cases/inc/utf8_substr.test.php @@ -26,5 +26,18 @@ class utf8_substr_test extends UnitTestCase { } } + function test2_bug891() { + // we test multiple cases here - format: in, offset, length, out + $tests = array(); + + $str = str_pad('',strlen('в')*66000,'в').'@@'; + $tests[] = array($str, 65600, 1, 'в'); + $tests[] = array($str,0,66000,$str); + + foreach($tests as $test){ + $this->assertEqual(utf8_substr($test[0],$test[1],$test[2]),$test[3]); + } + } + } //Setup VIM: ex: et ts=4 enc=utf-8 : |