From 0e70946d23660c4814db46cd3f89cb8340e51336 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 31 Aug 2006 11:21:46 +0200 Subject: add unittests for bug#891 darcs-hash:20060831092146-9b6ab-b00aa29c982ab18117f476b3d01d5111915c9d4b.gz --- _test/cases/inc/utf8_substr.test.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to '_test') 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 : -- cgit v1.2.3