[Python-checkins] CVS: python/dist/src/Lib/test test_ucn.py,1.6,1.7

Fredrik Lundh effbot@users.sourceforge.net
Sat, 20 Jan 2001 03:15:27 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv16317/Lib/test

Modified Files:
	test_ucn.py 
Log Message:


Better error message if ucnhash cannot be found (obscure attribute
errors aren't that helpful), or doesn't contain what's expected from
it.  Also tweaked the test script so it compiles even if ucnhash is
missing.


Index: test_ucn.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ucn.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** test_ucn.py	2001/01/19 11:13:46	1.6
--- test_ucn.py	2001/01/20 11:15:25	1.7
***************
*** 11,14 ****
--- 11,18 ----
  
  # General and case insensitivity test:
+ try:
+     # put all \N escapes inside exec'd raw strings, to make sure this
+     # script runs even if the compiler chokes on \N escapes
+     exec r"""
  s = u"\N{LATIN CAPITAL LETTER T}" \
      u"\N{LATIN SMALL LETTER H}" \
***************
*** 38,41 ****
--- 42,48 ----
      u"\N{FULL STOP}"
  verify(s == u"The rEd fOx ate the sheep.", s)
+ """
+ except UnicodeError, v:
+     print v
  print "done."
  
***************
*** 64,71 ****
--- 71,80 ----
  # misc. symbol testing
  print "Testing misc. symbols for unicode character name expansion....",
+ exec r"""
  verify(u"\N{PILCROW SIGN}" == u"\u00b6")
  verify(u"\N{REPLACEMENT CHARACTER}" == u"\uFFFD")
  verify(u"\N{HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK}" == u"\uFF9F")
  verify(u"\N{FULLWIDTH LATIN SMALL LETTER A}" == u"\uFF41")
+ """
  print "done."