Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef0a032

Browse files
committed
Patch by Finn Bock to make test_unicode.py work for Jython.
1 parent 9ae2148 commit ef0a032

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

Lib/test/test_unicode.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ def test_fixup(s):
261261
test('isupper', u'a', 0)
262262
test('isupper', u'A', 1)
263263
test('isupper', u'\n', 0)
264-
test('isupper', u'\u1FFc', 0)
264+
if sys.platform[:4] != 'java':
265+
test('isupper', u'\u1FFc', 0)
265266
test('isupper', u'ABC', 1)
266267
test('isupper', u'AbC', 0)
267268
test('isupper', u'ABC\n', 1)
@@ -339,13 +340,17 @@ def test_fixup(s):
339340
verify(u"%c" % ("a",) == u'a')
340341
verify(u"%c" % (34,) == u'"')
341342
verify(u"%c" % (36,) == u'$')
342-
value = u"%r, %r" % (u"abc", "abc")
343-
if value != u"u'abc', 'abc'":
344-
print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")'
343+
if sys.platform[:4] != 'java':
344+
value = u"%r, %r" % (u"abc", "abc")
345+
if value != u"u'abc', 'abc'":
346+
print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")'
345347

346348
verify(u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def')
347349
try:
348-
value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"}
350+
if sys.platform[:4] != 'java':
351+
value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"}
352+
else:
353+
value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä':"def"}
349354
except KeyError:
350355
print '*** formatting failed for "%s"' % "u'abc, def'"
351356
else:

0 commit comments

Comments
 (0)