From cc9a951f35c99f21b76c39e8c202cb467a412038 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 5 Oct 2005 11:39:12 +0000 Subject: SF #1313496: bisect C replacement doesn't accept named args --- Lib/test/test_bisect.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Lib/test') diff --git a/Lib/test/test_bisect.py b/Lib/test/test_bisect.py index 87448b3d50..f6e24a6994 100644 --- a/Lib/test/test_bisect.py +++ b/Lib/test/test_bisect.py @@ -130,6 +130,16 @@ class TestBisect(unittest.TestCase): def test_backcompatibility(self): self.assertEqual(bisect, bisect_right) + def test_keyword_args(self): + data = [10, 20, 30, 40, 50] + self.assertEqual(bisect_left(a=data, x=25, lo=1, hi=3), 2) + self.assertEqual(bisect_right(a=data, x=25, lo=1, hi=3), 2) + self.assertEqual(bisect(a=data, x=25, lo=1, hi=3), 2) + insort_left(a=data, x=25, lo=1, hi=3) + insort_right(a=data, x=25, lo=1, hi=3) + insort(a=data, x=25, lo=1, hi=3) + self.assertEqual(data, [10, 20, 25, 25, 25, 30, 40, 50]) + #============================================================================== class TestInsort(unittest.TestCase): -- cgit v1.2.1