summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-01-25 22:46:11 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-01-25 22:46:11 (GMT)
commit8afd7571a18593bef57d98ccd68865fd1d400643 (patch)
treeef091620849b0a497568b274dcf59bdbf266ed3b /Lib/test/test_builtin.py
parentfc03a94aaccc9ae606ee3438ca21d65a335d43e9 (diff)
downloadcpython-8afd7571a18593bef57d98ccd68865fd1d400643.zip
cpython-8afd7571a18593bef57d98ccd68865fd1d400643.tar.gz
cpython-8afd7571a18593bef57d98ccd68865fd1d400643.tar.bz2
Patch #636005: Filter unicode into unicode.
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r--Lib/test/test_builtin.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 60358a4..eb4b3d2 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -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)