[pypy-commit] pypy default: (Taggnostr2)
arigo
noreply at buildbot.pypy.org
Mon Aug 15 10:50:35 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r46511:3e256cf5f692
Date: 2011-08-15 09:15 +0200
http://bitbucket.org/pypy/pypy/changeset/3e256cf5f692/
Log: (Taggnostr2) Add a test for capitalize() just checked into the
CPython 2.7 branch.
diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py
--- a/pypy/objspace/std/test/test_unicodeobject.py
+++ b/pypy/objspace/std/test/test_unicodeobject.py
@@ -211,6 +211,20 @@
assert u'hello '.capitalize() == u'Hello '
assert u'aaaa'.capitalize() == u'Aaaa'
assert u'AaAa'.capitalize() == u'Aaaa'
+ # check that titlecased chars are lowered correctly
+ # \u1ffc is the titlecased char
+ assert (u'\u1ff3\u1ff3\u1ffc\u1ffc'.capitalize() ==
+ u'\u1ffc\u1ff3\u1ff3\u1ff3')
+ # check with cased non-letter chars
+ assert (u'\u24c5\u24ce\u24c9\u24bd\u24c4\u24c3'.capitalize() ==
+ u'\u24c5\u24e8\u24e3\u24d7\u24de\u24dd')
+ assert (u'\u24df\u24e8\u24e3\u24d7\u24de\u24dd'.capitalize() ==
+ u'\u24c5\u24e8\u24e3\u24d7\u24de\u24dd')
+ assert u'\u2160\u2161\u2162'.capitalize() == u'\u2160\u2171\u2172'
+ assert u'\u2170\u2171\u2172'.capitalize() == u'\u2160\u2171\u2172'
+ # check with Ll chars with no upper - nothing changes here
+ assert (u'\u019b\u1d00\u1d86\u0221\u1fb7'.capitalize() ==
+ u'\u019b\u1d00\u1d86\u0221\u1fb7')
def test_rjust(self):
s = u"abc"
@@ -834,4 +848,4 @@
assert type(b) is unicode
assert b == u'hello \u1234'
- assert u'%s' % S(u'mar\xe7') == u'mar\xe7'
\ No newline at end of file
+ assert u'%s' % S(u'mar\xe7') == u'mar\xe7'
More information about the pypy-commit
mailing list