mirror of https://github.com/python/cpython.git
Issue #17223: Add another test to check that _PyUnicode_Ready() rejects
code points bigger than U+10ffff
This commit is contained in:
parent
87a249c119
commit
e5c0533b58
|
@ -1418,6 +1418,16 @@ test_widechar(PyObject *self)
|
||||||
else
|
else
|
||||||
return raiseTestError("test_widechar",
|
return raiseTestError("test_widechar",
|
||||||
"PyUnicode_FromUnicode(L\"\\U00110000\", 1) didn't fail");
|
"PyUnicode_FromUnicode(L\"\\U00110000\", 1) didn't fail");
|
||||||
|
|
||||||
|
wide = PyUnicode_FromUnicode(NULL, 1);
|
||||||
|
if (wide == NULL)
|
||||||
|
return NULL;
|
||||||
|
PyUnicode_AS_UNICODE(wide)[0] = invalid[0];
|
||||||
|
if (_PyUnicode_Ready(wide) < 0)
|
||||||
|
PyErr_Clear();
|
||||||
|
else
|
||||||
|
return raiseTestError("test_widechar",
|
||||||
|
"PyUnicode_Ready() didn't fail");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
|
Loading…
Reference in New Issue