]> granicus.if.org Git - python/commitdiff
#12266: move the tests in test_unicode.
authorEzio Melotti <ezio.melotti@gmail.com>
Mon, 15 Aug 2011 07:04:28 +0000 (10:04 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Mon, 15 Aug 2011 07:04:28 +0000 (10:04 +0300)
Lib/test/string_tests.py
Lib/test/test_unicode.py

index 9cf334573d68ef54d5ea39ecb5a67b8876a3af94..5931f3d88ba26d6f6559880743a36f3b8371375f 100644 (file)
@@ -96,23 +96,6 @@ class CommonTest(unittest.TestCase):
         self.checkequal('Aaaa', 'aaaa', 'capitalize')
         self.checkequal('Aaaa', 'AaAa', 'capitalize')
 
-        # check that titlecased chars are lowered correctly
-        # \u1ffc is the titlecased char
-        self.checkequal(u'\u1ffc\u1ff3\u1ff3\u1ff3',
-                        u'\u1ff3\u1ff3\u1ffc\u1ffc', 'capitalize')
-        # check with cased non-letter chars
-        self.checkequal(u'\u24c5\u24e8\u24e3\u24d7\u24de\u24dd',
-                        u'\u24c5\u24ce\u24c9\u24bd\u24c4\u24c3', 'capitalize')
-        self.checkequal(u'\u24c5\u24e8\u24e3\u24d7\u24de\u24dd',
-                        u'\u24df\u24e8\u24e3\u24d7\u24de\u24dd', 'capitalize')
-        self.checkequal(u'\u2160\u2171\u2172',
-                        u'\u2160\u2161\u2162', 'capitalize')
-        self.checkequal(u'\u2160\u2171\u2172',
-                        u'\u2170\u2171\u2172', 'capitalize')
-        # check with Ll chars with no upper - nothing changes here
-        self.checkequal(u'\u019b\u1d00\u1d86\u0221\u1fb7',
-                        u'\u019b\u1d00\u1d86\u0221\u1fb7', 'capitalize')
-
         self.checkraises(TypeError, 'hello', 'capitalize', 42)
 
     def test_count(self):
index bd43dbc57b7ff47778131a282b190166398dbfd1..d5394e686468d58a607e0e946f1dd02e8f3264cb 100644 (file)
@@ -269,6 +269,25 @@ class UnicodeTest(
         # Surrogates on both sides, no fixup required
         self.assertTrue(u'\ud800\udc02' < u'\ud84d\udc56')
 
+    def test_capitalize(self):
+        string_tests.CommonTest.test_capitalize(self)
+        # check that titlecased chars are lowered correctly
+        # \u1ffc is the titlecased char
+        self.checkequal(u'\u1ffc\u1ff3\u1ff3\u1ff3',
+                        u'\u1ff3\u1ff3\u1ffc\u1ffc', 'capitalize')
+        # check with cased non-letter chars
+        self.checkequal(u'\u24c5\u24e8\u24e3\u24d7\u24de\u24dd',
+                        u'\u24c5\u24ce\u24c9\u24bd\u24c4\u24c3', 'capitalize')
+        self.checkequal(u'\u24c5\u24e8\u24e3\u24d7\u24de\u24dd',
+                        u'\u24df\u24e8\u24e3\u24d7\u24de\u24dd', 'capitalize')
+        self.checkequal(u'\u2160\u2171\u2172',
+                        u'\u2160\u2161\u2162', 'capitalize')
+        self.checkequal(u'\u2160\u2171\u2172',
+                        u'\u2170\u2171\u2172', 'capitalize')
+        # check with Ll chars with no upper - nothing changes here
+        self.checkequal(u'\u019b\u1d00\u1d86\u0221\u1fb7',
+                        u'\u019b\u1d00\u1d86\u0221\u1fb7', 'capitalize')
+
     def test_islower(self):
         string_tests.MixinStrUnicodeUserStringTest.test_islower(self)
         self.checkequalnofix(False, u'\u1FFc', 'islower')