From: Ezio Melotti Date: Mon, 8 Jul 2013 15:48:29 +0000 (+0200) Subject: Add a couple of tests for str.center with non-ASCII chars. X-Git-Tag: v3.4.0a1~291^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f84e01df318e625e958ccccf566c8a01eea6ff6b;p=thirdparty%2FPython%2Fcpython.git Add a couple of tests for str.center with non-ASCII chars. --- diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 0c82560ca7aa..b8a5f5e83459 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -652,6 +652,15 @@ class UnicodeTest(string_tests.CommonTest, self.assertEqual('ß'.swapcase(), 'SS') self.assertEqual('\u1fd2'.swapcase(), '\u0399\u0308\u0300') + def test_center(self): + string_tests.CommonTest.test_center(self) + self.assertEqual('x'.center(2, '\U0010FFFF'), + 'x\U0010FFFF') + self.assertEqual('x'.center(3, '\U0010FFFF'), + '\U0010FFFFx\U0010FFFF') + self.assertEqual('x'.center(4, '\U0010FFFF'), + '\U0010FFFFx\U0010FFFF\U0010FFFF') + def test_contains(self): # Testing Unicode contains method self.assertIn('a', 'abdb')