mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Patch #636005: Filter unicode into unicode.
This commit is contained in:
parent
fc03a94aac
commit
8afd7571a1
3 changed files with 70 additions and 0 deletions
|
@ -365,6 +365,12 @@ class BuiltinTest(unittest.TestCase):
|
|||
def __getitem__(self, index):
|
||||
raise ValueError
|
||||
self.assertRaises(ValueError, filter, lambda x: x >="3", badstr("1234"))
|
||||
if have_unicode:
|
||||
# test biltinmodule.c::filterstring()
|
||||
self.assertEqual(filter(None, unicode("12")), unicode("12"))
|
||||
self.assertEqual(filter(lambda x: x>="3", unicode("1234")), unicode("34"))
|
||||
self.assertRaises(TypeError, filter, 42, unicode("12"))
|
||||
self.assertRaises(ValueError, filter, lambda x: x >="3", badstr(unicode("1234")))
|
||||
|
||||
def test_float(self):
|
||||
self.assertEqual(float(3.14), 3.14)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue