mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
SF #1313496: bisect C replacement doesn't accept named args
This commit is contained in:
parent
892a33f85a
commit
cc9a951f35
2 changed files with 36 additions and 22 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue