Commit 99b3dde6 authored by Ezio Melotti's avatar Ezio Melotti

Add a couple of tests for str.center with non-ASCII chars.

parent e84fbc72
......@@ -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')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment