]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
doerwalter's failing examples from
authorMichael W. Hudson <mwh@python.net>
Mon, 18 Mar 2002 12:54:51 +0000 (12:54 +0000)
committerMichael W. Hudson <mwh@python.net>
Mon, 18 Mar 2002 12:54:51 +0000 (12:54 +0000)
[ 529104 ] broken error handling in unicode-escape

Lib/test/test_unicode.py

index 8d4bed56474136464c6e1d15c9630628b4a4e1ab..df5d6159ba0b611a1f2316fdc7bcf62029d6ec0c 100644 (file)
@@ -539,6 +539,14 @@ else:
 verify(unicode('Andr\202 x','ascii','ignore') == u"Andr x")
 verify(unicode('Andr\202 x','ascii','replace') == u'Andr\uFFFD x')
 
+verify("\\N{foo}xx".decode("unicode-escape", "ignore") == u"xx")
+try:
+    "\\".decode("unicode-escape")
+except ValueError:
+    pass
+else:
+    raise TestFailed, '"\\".decode("unicode-escape") should fail'
+
 verify(u'hello'.encode('ascii') == 'hello')
 verify(u'hello'.encode('utf-7') == 'hello')
 verify(u'hello'.encode('utf-8') == 'hello')