refactored the unicodeobject/ucnhash interface, to hide the

implementation details inside the ucnhash module.

also cleaned up the unicode copyright blurb a little; Secret Labs'
internal revision history isn't that interesting...
This commit is contained in:
Fredrik Lundh 2001-01-19 09:45:02 +00:00
parent a2bf2709b3
commit 0fdb90cafe
4 changed files with 144 additions and 208 deletions

View file

@ -50,16 +50,6 @@ print "done."
# strict error testing:
print "Testing unicode character name expansion strict error handling....",
k_cchMaxUnicodeName = 83
s = "\N{" + "1" * (k_cchMaxUnicodeName + 2) + "}"
try:
unicode(s, 'unicode-escape', 'strict')
except UnicodeError:
pass
else:
raise AssertionError, "failed to raise an exception when presented " \
"with a UCN > k_cchMaxUnicodeName"
try:
unicode("\N{blah}", 'unicode-escape', 'strict')
except UnicodeError:
@ -67,6 +57,14 @@ except UnicodeError:
else:
raise AssertionError, "failed to raise an exception when given a bogus character name"
try:
unicode("\N{" + "x" * 100000 + "}", 'unicode-escape', 'strict')
except UnicodeError:
pass
else:
raise AssertionError, "failed to raise an exception when given a very " \
"long bogus character name"
try:
unicode("\N{SPACE", 'unicode-escape', 'strict')
except UnicodeError: