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...
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
index 92155be..a33d111 100644
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -50,16 +50,6 @@
# 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:
@@ -68,6 +58,14 @@
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:
pass