summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bisect.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-10-05 11:39:12 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-10-05 11:39:12 (GMT)
commitcc9a951f35c99f21b76c39e8c202cb467a412038 (patch)
tree7fc5a0cf33a6b8305d7bcbdc488b622992973bfd /Lib/test/test_bisect.py
parent892a33f85aca8e399509c2c673a02124d24d1991 (diff)
downloadcpython-cc9a951f35c99f21b76c39e8c202cb467a412038.zip
cpython-cc9a951f35c99f21b76c39e8c202cb467a412038.tar.gz
cpython-cc9a951f35c99f21b76c39e8c202cb467a412038.tar.bz2
SF #1313496: bisect C replacement doesn't accept named args
Diffstat (limited to 'Lib/test/test_bisect.py')
-rw-r--r--Lib/test/test_bisect.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_bisect.py b/Lib/test/test_bisect.py
index 87448b3..f6e24a6 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):