diff options
author | Hye-Shik Chang <hyeshik@gmail.com> | 2004-06-04 04:24:54 (GMT) |
---|---|---|
committer | Hye-Shik Chang <hyeshik@gmail.com> | 2004-06-04 04:24:54 (GMT) |
commit | 3c145449daa8356c6ae4c296ffb24b5214647442 (patch) | |
tree | 1251c8ee3468ec849be7868c9580d2694230662b /Lib/test/test_unicode.py | |
parent | 6838c557faaffc9fb54091dd3fa8e37ca70ab069 (diff) | |
download | cpython-3c145449daa8356c6ae4c296ffb24b5214647442.zip cpython-3c145449daa8356c6ae4c296ffb24b5214647442.tar.gz cpython-3c145449daa8356c6ae4c296ffb24b5214647442.tar.bz2 |
Reuse width/iswide tests from strings_test. (Suggested by Walter Dörwald)
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 4b16f90..e2db207 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -11,7 +11,8 @@ from test import test_support, string_tests class UnicodeTest( string_tests.CommonTest, - string_tests.MixinStrUnicodeUserStringTest + string_tests.MixinStrUnicodeUserStringTest, + string_tests.MixinUnicodeUserStringTest ): type2test = unicode @@ -291,26 +292,6 @@ class UnicodeTest( self.assertRaises(TypeError, u"abc".isnumeric, 42) - def test_iswide(self): - self.checkequalnofix(False, u'', 'iswide') - self.checkequalnofix(False, u'\x1f', 'iswide') # Neutral - self.checkequalnofix(False, u'\x20', 'iswide') # Narrow - self.checkequalnofix(True, u'\u2329', 'iswide') # Wide - self.checkequalnofix(False, u'\uff64', 'iswide') # Half - self.checkequalnofix(True, u'\u3000', 'iswide') # Full - self.checkequalnofix(False, u'\u2460', 'iswide') # Ambiguous - self.checkequalnofix(True, u'\ud55c\uae00', 'iswide') - self.checkequalnofix(False, u'\ud55c\u2606\uae00', 'iswide') - - def test_width(self): - self.assertEqual(u''.width(), 0) - self.assertEqual(u'abcd'.width(), 4) - self.assertEqual(u'\u0187\u01c9'.width(), 2) - self.assertEqual(u'\u2460\u2329'.width(), 3) - self.assertEqual(u'\u2329\u2460'.width(), 3) - self.assertEqual(u'\ud55c\uae00'.width(), 4) - self.assertEqual(u'\ud55c\u2606\uae00'.width(), 5) - def test_contains(self): # Testing Unicode contains method self.assert_('a' in u'abdb') |