summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-12-04 03:38:46 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-12-04 03:38:46 (GMT)
commit942af5a9a45b7b4976bea2e794eccaaf2b3b5c09 (patch)
treef621bdffa16dd0b04d7bf60d6a32f198fc7b3ec8 /Lib/test/test_unicode.py
parent36526bf3d95763afa6d4efe402b8840b1532d637 (diff)
downloadcpython-942af5a9a45b7b4976bea2e794eccaaf2b3b5c09.zip
cpython-942af5a9a45b7b4976bea2e794eccaaf2b3b5c09.tar.gz
cpython-942af5a9a45b7b4976bea2e794eccaaf2b3b5c09.tar.bz2
Issue #10557: Fixed error messages from float() and other numeric
types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents.
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index c5a0f80..2de9e7f 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1168,8 +1168,13 @@ class UnicodeTest(string_tests.CommonTest,
# Error handling (wrong arguments)
self.assertRaises(TypeError, "hello".encode, 42, 42, 42)
- # Error handling (PyUnicode_EncodeDecimal())
- self.assertRaises(UnicodeError, int, "\u0200")
+ # Error handling (lone surrogate in PyUnicode_TransformDecimalToASCII())
+ self.assertRaises(UnicodeError, int, "\ud800")
+ self.assertRaises(UnicodeError, int, "\udf00")
+ self.assertRaises(UnicodeError, float, "\ud800")
+ self.assertRaises(UnicodeError, float, "\udf00")
+ self.assertRaises(UnicodeError, complex, "\ud800")
+ self.assertRaises(UnicodeError, complex, "\udf00")
def test_codecs(self):
# Encoding