[Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.31,1.31.6.1

Tim Peters tim_one@users.sourceforge.net
2001年7月06日 00:01:33 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv9655/descr/dist/src/Lib/test
Modified Files:
 Tag: descr-branch
	test_unicode.py 
Log Message:
THought I'd start the merge with something "obviously easy". Heh.
One thing leads to another, and test_unicode.py fails now. But it's due
to this bug:
>>> "%*s" % (5, "abc")
' abc'
>>> "%*s" % (5, u"abc")
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
TypeError: * wants int
>>>
This *form* of test (a %*s format) didn't used to exist in test_unicode.py,
so my best guess is that this is a legit bug in the descr-branch. If so,
no reason not to check this in; perhaps the true error is somewhere in
still untouched Unicode-specific merges, though.
Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.31
retrieving revision 1.31.6.1
diff -C2 -r1.31 -r1.31.6.1
*** test_unicode.py	2001年02月10日 14:09:31	1.31
--- test_unicode.py	2001年07月06日 07:01:30	1.31.6.1
***************
*** 6,10 ****
 
 """#"
! from test_support import verify, verbose
 import sys
 
--- 6,10 ----
 
 """#"
! from test_support import verify, verbose, TestFailed
 import sys
 
***************
*** 367,370 ****
--- 367,376 ----
 verify('...%%...%%s...%s...%s...%s...%s...' % (1,2,3,u"abc") == u'...%...%s...1...2...3...abc...')
 verify('...%s...' % u"abc" == u'...abc...')
+ verify('%*s' % (5,u'abc',) == u' abc')
+ verify('%*s' % (-5,u'abc',) == u'abc ')
+ verify('%*.*s' % (5,2,u'abc',) == u' ab')
+ verify('%*.*s' % (5,3,u'abc',) == u' abc')
+ verify('%i %*.*s' % (10, 5,3,u'abc',) == u'10 abc')
+ verify('%i%s %*.*s' % (10, 3, 5,3,u'abc',) == u'103 abc')
 print 'done.'
 
***************
*** 381,387 ****
 # UTF-8 specific decoding tests
 verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))),
! 'utf-8') == u'\ud84d\udc56' )
 verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))),
! 'utf-8') == u'\ud800\udc02' )
 verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))),
 'utf-8') == u'\u20ac' )
--- 387,393 ----
 # UTF-8 specific decoding tests
 verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))),
! 'utf-8') == u'\U00023456' )
 verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))),
! 'utf-8') == u'\U00010002' )
 verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))),
 'utf-8') == u'\u20ac' )
***************
*** 488,495 ****
 
 'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
! 'cp1006', 'cp875', 'iso8859_8',
 
 ### These have undefined mappings:
 #'cp424',
 
 ):
--- 494,504 ----
 
 'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
! 'cp1006', 'iso8859_8',
 
 ### These have undefined mappings:
 #'cp424',
+ 
+ ### These fail the round-trip:
+ #'cp875'
 
 ):

AltStyle によって変換されたページ (->オリジナル) /