Commit f5f040e2 authored by Walter Dörwald's avatar Walter Dörwald

Add a test that exercises the error handling part of

PyUnicode_EncodeDecimal().
parent dc875857
...@@ -679,6 +679,12 @@ except ValueError: ...@@ -679,6 +679,12 @@ except ValueError:
pass pass
else: else:
raise TestFailed, '"\\".decode("unicode-escape") should fail' raise TestFailed, '"\\".decode("unicode-escape") should fail'
try:
int(u"\u0200")
except UnicodeError:
pass
else:
raise TestFailed, "int(u'\\u0200') failed to raise an exception"
verify(u'hello'.encode('ascii') == 'hello') verify(u'hello'.encode('ascii') == 'hello')
verify(u'hello'.encode('utf-7') == 'hello') verify(u'hello'.encode('utf-7') == 'hello')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment