]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
improved the ucnhash test a bit
authorFredrik Lundh <fredrik@pythonware.com>
Fri, 19 Jan 2001 11:13:46 +0000 (11:13 +0000)
committerFredrik Lundh <fredrik@pythonware.com>
Fri, 19 Jan 2001 11:13:46 +0000 (11:13 +0000)
Lib/test/output/test_ucn
Lib/test/test_ucn.py

index 49e08ff2d1bef373ceef7cf21ce4be51addd8537..aee91b2f765b197a3599a0d0dac8a6c925ea56fb 100644 (file)
@@ -1,4 +1,7 @@
 test_ucn
 Testing General Unicode Character Name, and case insensitivity... done.
+Testing name to code mapping.... done.
+Testing code to name mapping for all characters.... done.
+Found 10538 characters in the unicode name database
 Testing misc. symbols for unicode character name expansion.... done.
 Testing unicode character name expansion strict error handling.... done.
index a51dc9a72e3bb3bbd941a67d33ac61e600453d3c..f680140f153ef7fc31f2dde2e9530ff7b608ae20 100644 (file)
@@ -37,25 +37,30 @@ s = u"\N{LATIN CAPITAL LETTER T}" \
     u"\N{LATIN SMALL LETTER P}" \
     u"\N{FULL STOP}"
 verify(s == u"The rEd fOx ate the sheep.", s)
+print "done."
 
 import ucnhash
 
-# minimal sanity check
+print "Testing name to code mapping....",
 for char in "SPAM":
     name = "LATIN SMALL LETTER %s" % char
     code = ucnhash.getcode(name)
     verify(ucnhash.getname(code) == name)
+print "done."
 
-# loop over all characters in the database
+print "Testing code to name mapping for all characters....",
+count = 0
 for code in range(65536):
     try:
         name = ucnhash.getname(code)
         verify(ucnhash.getcode(name) == code)
+        count += 1
     except ValueError:
         pass
-
 print "done."
 
+print "Found", count, "characters in the unicode name database"
+
 # misc. symbol testing
 print "Testing misc. symbols for unicode character name expansion....",
 verify(u"\N{PILCROW SIGN}" == u"\u00b6")