[Python-checkins] python/dist/src/Lib/test test_unicode.py,1.70,1.71

loewis@users.sourceforge.net loewis@users.sourceforge.net
2002年9月14日 02:19:55 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv13109
Modified Files:
	test_unicode.py 
Log Message:
Don't test whether surrogate sequences round-trip in UTF-8. 2.2.2 candidate.
Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** test_unicode.py	14 Sep 2002 09:10:04 -0000	1.70
--- test_unicode.py	14 Sep 2002 09:19:53 -0000	1.71
***************
*** 696,700 ****
 
 # UTF-8 must be roundtrip safe for all UCS-2 code points
! u = u''.join(map(unichr, range(0x10000)))
 for encoding in ('utf-8',):
 verify(unicode(u.encode(encoding),encoding) == u)
--- 696,703 ----
 
 # UTF-8 must be roundtrip safe for all UCS-2 code points
! # This excludes surrogates: in the full range, there would be
! # a surrogate pair (\udbff\udc00), which gets converted back
! # to a non-BMP character (\U0010fc00)
! u = u''.join(map(unichr, range(0,0xd800)+range(0xe000,0x10000)))
 for encoding in ('utf-8',):
 verify(unicode(u.encode(encoding),encoding) == u)

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