[Python-checkins] cpython: Move UCS4-specific tests with the "normal" tests.

ezio.melotti python-checkins at python.org
Thu Sep 29 02:15:08 CEST 2011


http://hg.python.org/cpython/rev/9f41acdb3150
changeset:   72514:9f41acdb3150
parent:      72512:36fc514de7f0
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Thu Sep 29 03:14:56 2011 +0300
summary:
  Move UCS4-specific tests with the "normal" tests.

files:
  Lib/test/test_unicodedata.py |  12 ++++--------
  1 files changed, 4 insertions(+), 8 deletions(-)


diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -108,6 +108,7 @@
         self.assertEqual(self.db.digit('\u215b', None), None)
         self.assertEqual(self.db.digit('\u2468'), 9)
         self.assertEqual(self.db.digit('\U00020000', None), None)
+        self.assertEqual(self.db.digit('\U0001D7FD'), 7)
 
         self.assertRaises(TypeError, self.db.digit)
         self.assertRaises(TypeError, self.db.digit, 'xx')
@@ -120,6 +121,7 @@
         self.assertEqual(self.db.numeric('\u2468'), 9.0)
         self.assertEqual(self.db.numeric('\ua627'), 7.0)
         self.assertEqual(self.db.numeric('\U00020000', None), None)
+        self.assertEqual(self.db.numeric('\U0001012A'), 9000)
 
         self.assertRaises(TypeError, self.db.numeric)
         self.assertRaises(TypeError, self.db.numeric, 'xx')
@@ -131,6 +133,7 @@
         self.assertEqual(self.db.decimal('\u215b', None), None)
         self.assertEqual(self.db.decimal('\u2468', None), None)
         self.assertEqual(self.db.decimal('\U00020000', None), None)
+        self.assertEqual(self.db.decimal('\U0001D7FD'), 7)
 
         self.assertRaises(TypeError, self.db.decimal)
         self.assertRaises(TypeError, self.db.decimal, 'xx')
@@ -141,6 +144,7 @@
         self.assertEqual(self.db.category('a'), 'Ll')
         self.assertEqual(self.db.category('A'), 'Lu')
         self.assertEqual(self.db.category('\U00020000'), 'Lo')
+        self.assertEqual(self.db.category('\U0001012A'), 'No')
 
         self.assertRaises(TypeError, self.db.category)
         self.assertRaises(TypeError, self.db.category, 'xx')
@@ -308,14 +312,6 @@
                 self.assertEqual(len(lines), 1,
                                  r"\u%.4x should not be a linebreak" % i)
 
-    def test_UCS4(self):
-        # unicodedata should work with code points outside the BMP
-        # even on a narrow Unicode build
-        self.assertEqual(self.db.category("\U0001012A"), "No")
-        self.assertEqual(self.db.numeric("\U0001012A"), 9000)
-        self.assertEqual(self.db.decimal("\U0001D7FD"), 7)
-        self.assertEqual(self.db.digit("\U0001D7FD"), 7)
-
 def test_main():
     test.support.run_unittest(
         UnicodeMiscTest,

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list