Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r95781:c0c8a1eba246
Date: 2019-02-03 09:57 +0200
http://bitbucket.org/pypy/pypy/changeset/c0c8a1eba246/

Log:    add passing test

diff --git a/pypy/interpreter/test/test_unicodehelper.py 
b/pypy/interpreter/test/test_unicodehelper.py
--- a/pypy/interpreter/test/test_unicodehelper.py
+++ b/pypy/interpreter/test/test_unicodehelper.py
@@ -181,3 +181,12 @@
         u'12\u1234'.encode('utf8'), 'xmlcharrefreplace', handler)
     assert result == '12&#4660;'
 
[email protected](sys.platform != 'win32', reason='Windows only test')
+def test_encode_mbcs(space):
+    u = u"abc" + u"-\u5171\u0141\u2661\u0363\uDC80"
+    utf8 = u.encode('utf8')
+    with pytest.raises(UnicodeEncodeError):
+        def eh(errors, enc, msg, b, startingpos, endingpos):
+             u = b.decode('utf-8')
+             raise UnicodeEncodeError(enc, u, startingpos, endingpos, msg)
+        uh.utf8_encode_mbcs(utf8, 'strict', eh)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to