SF #1313496: bisect C replacement doesn't accept named args

This commit is contained in:
Raymond Hettinger 2005-10-05 11:39:12 +00:00
parent 892a33f85a
commit cc9a951f35
2 changed files with 36 additions and 22 deletions

View file

@ -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):