summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-07-08 15:48:29 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-07-08 15:48:29 (GMT)
commitf84e01df318e625e958ccccf566c8a01eea6ff6b (patch)
treebd4b2613055539c8ec7e35f63db26acfb84dd43c
parentb08495bbcfea7440f56bbc786b64cbaadaeb604f (diff)
downloadcpython-f84e01df318e625e958ccccf566c8a01eea6ff6b.zip
cpython-f84e01df318e625e958ccccf566c8a01eea6ff6b.tar.gz
cpython-f84e01df318e625e958ccccf566c8a01eea6ff6b.tar.bz2
Add a couple of tests for str.center with non-ASCII chars.
-rw-r--r--Lib/test/test_unicode.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 0c82560..b8a5f5e 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')