summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/encodings/mbcs.py1
-rw-r--r--Lib/test/output/test_unicode3
-rw-r--r--Lib/test/output/test_unicodedata2
-rw-r--r--Lib/test/test_unicode.py45
-rw-r--r--Lib/test/test_unicodedata.py50
5 files changed, 54 insertions, 47 deletions
diff --git a/Lib/encodings/mbcs.py b/Lib/encodings/mbcs.py
index b7fafbd..5103980 100644
--- a/Lib/encodings/mbcs.py
+++ b/Lib/encodings/mbcs.py
@@ -34,4 +34,3 @@ class StreamConverter(StreamWriter,StreamReader):
def getregentry():
return (Codec.encode,Codec.decode,StreamReader,StreamWriter)
-
diff --git a/Lib/test/output/test_unicode b/Lib/test/output/test_unicode
index 1ec9031..88e8624 100644
--- a/Lib/test/output/test_unicode
+++ b/Lib/test/output/test_unicode
@@ -1,4 +1,5 @@
test_unicode
Testing Unicode comparisons... done.
+Testing Unicode contains method... done.
Testing Unicode formatting strings... done.
-Testing unicodedata module... done.
+Testing builtin codecs... done.
diff --git a/Lib/test/output/test_unicodedata b/Lib/test/output/test_unicodedata
new file mode 100644
index 0000000..fc9562f
--- /dev/null
+++ b/Lib/test/output/test_unicodedata
@@ -0,0 +1,2 @@
+test_unicodedata
+Testing unicodedata module... done.
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 3d15f22..f90887a 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1,6 +1,5 @@
""" Test script for the Unicode implementation.
-
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
@@ -250,50 +249,6 @@ assert u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def'
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
print 'Testing builtin codecs...',
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
new file mode 100644
index 0000000..6ddd077
--- /dev/null
+++ b/Lib/test/test_unicodedata.py
@@ -0,0 +1,50 @@
+""" Test script for the unicodedata module.
+
+Written by Marc-Andre Lemburg (mal@lemburg.com).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+
+"""#"
+from test_support import verbose
+import sys
+
+# Test Unicode database APIs
+import unicodedata
+
+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.'