diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_unicode.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 56f1811..ad47f31 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -541,6 +541,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') |