[Python-checkins] CVS: python/dist/src/Lib/test test_unicodedata.py,NONE,1.1 test_unicode.py,1.4,1.5
Guido van Rossum
python-dev@python.org
Tue, 28 Mar 2000 15:30:00 -0500 (EST)
Update of /projects/cvsroot/python/dist/src/Lib/test
In directory eric:/home/guido/hp/mal/py-patched/Lib/test
Modified Files:
test_unicode.py
Added Files:
test_unicodedata.py
Log Message:
Marc-Andre Lemburg:
The attached patch set includes a workaround to get Python with
Unicode compile on BSDI 4.x (courtesy Thomas Wouters; the cause
is a bug in the BSDI wchar.h header file) and Python interfaces
for the MBCS codec donated by Mark Hammond.
Also included are some minor corrections w/r to the docs of
the new "es" and "es#" parser markers (use PyMem_Free() instead
of free(); thanks to Mark Hammond for finding these).
The unicodedata tests are now in a separate file
(test_unicodedata.py) to avoid problems if the module cannot
be found.
Index: test_unicode.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** test_unicode.py 2000/03/24 22:14:18 1.4
--- test_unicode.py 2000/03/28 20:29:57 1.5
***************
*** 1,5 ****
""" Test script for the Unicode implementation.
-
Written by Marc-Andre Lemburg (mal@lemburg.com).
--- 1,4 ----
***************
*** 250,297 ****
assert u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"} == u'abc, def'
print 'done.'
-
- # Test Unicode database APIs
- try:
- import unicodedata
- except ImportError:
- pass
- else:
- print 'Testing unicodedata module...',
-
- assert unicodedata.digit(u'A',None) is None
- assert unicodedata.digit(u'9') == 9
- assert unicodedata.digit(u'\u215b',None) is None
- assert unicodedata.digit(u'\u2468') == 9
-
- assert unicodedata.numeric(u'A',None) is None
- assert unicodedata.numeric(u'9') == 9
- assert unicodedata.numeric(u'\u215b') == 0.125
- assert unicodedata.numeric(u'\u2468') == 9.0
-
- assert unicodedata.decimal(u'A',None) is None
- assert unicodedata.decimal(u'9') == 9
- assert unicodedata.decimal(u'\u215b',None) is None
- assert unicodedata.decimal(u'\u2468',None) is None
-
- assert unicodedata.category(u'\uFFFE') == 'Cn'
- assert unicodedata.category(u'a') == 'Ll'
- assert unicodedata.category(u'A') == 'Lu'
-
- assert unicodedata.bidirectional(u'\uFFFE') == ''
- assert unicodedata.bidirectional(u' ') == 'WS'
- assert unicodedata.bidirectional(u'A') == 'L'
-
- assert unicodedata.decomposition(u'\uFFFE') == ''
- assert unicodedata.decomposition(u'\u00bc') == '<fraction> 0031 2044 0034'
-
- assert unicodedata.mirrored(u'\uFFFE') == 0
- assert unicodedata.mirrored(u'a') == 0
- assert unicodedata.mirrored(u'\u2201') == 1
-
- assert unicodedata.combining(u'\uFFFE') == 0
- assert unicodedata.combining(u'a') == 0
- assert unicodedata.combining(u'\u20e1') == 230
-
- print 'done.'
# Test builtin codecs
--- 249,252 ----