mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Patch by Finn Bock to make test_unicode.py work for Jython.
This commit is contained in:
		
							parent
							
								
									9ae2148ada
								
							
						
					
					
						commit
						ef0a032883
					
				
					 1 changed files with 10 additions and 5 deletions
				
			
		| 
						 | 
					@ -261,7 +261,8 @@ def test_fixup(s):
 | 
				
			||||||
test('isupper', u'a', 0)
 | 
					test('isupper', u'a', 0)
 | 
				
			||||||
test('isupper', u'A', 1)
 | 
					test('isupper', u'A', 1)
 | 
				
			||||||
test('isupper', u'\n', 0)
 | 
					test('isupper', u'\n', 0)
 | 
				
			||||||
test('isupper', u'\u1FFc', 0)
 | 
					if sys.platform[:4] != 'java':
 | 
				
			||||||
 | 
					    test('isupper', u'\u1FFc', 0)
 | 
				
			||||||
test('isupper', u'ABC', 1)
 | 
					test('isupper', u'ABC', 1)
 | 
				
			||||||
test('isupper', u'AbC', 0)
 | 
					test('isupper', u'AbC', 0)
 | 
				
			||||||
test('isupper', u'ABC\n', 1)
 | 
					test('isupper', u'ABC\n', 1)
 | 
				
			||||||
| 
						 | 
					@ -339,13 +340,17 @@ def test_fixup(s):
 | 
				
			||||||
verify(u"%c" % ("a",) == u'a')
 | 
					verify(u"%c" % ("a",) == u'a')
 | 
				
			||||||
verify(u"%c" % (34,) == u'"')
 | 
					verify(u"%c" % (34,) == u'"')
 | 
				
			||||||
verify(u"%c" % (36,) == u'$')
 | 
					verify(u"%c" % (36,) == u'$')
 | 
				
			||||||
value = u"%r, %r" % (u"abc", "abc")
 | 
					if sys.platform[:4] != 'java':
 | 
				
			||||||
if value != u"u'abc', 'abc'":
 | 
					    value = u"%r, %r" % (u"abc", "abc")
 | 
				
			||||||
    print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")'
 | 
					    if value != u"u'abc', 'abc'":
 | 
				
			||||||
 | 
					        print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
verify(u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def')
 | 
					verify(u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def')
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
    value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"}
 | 
					    if sys.platform[:4] != 'java':
 | 
				
			||||||
 | 
					        value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"}
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä':"def"}
 | 
				
			||||||
except KeyError:
 | 
					except KeyError:
 | 
				
			||||||
    print '*** formatting failed for "%s"' % "u'abc, def'"
 | 
					    print '*** formatting failed for "%s"' % "u'abc, def'"
 | 
				
			||||||
else:
 | 
					else:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue