MCPcopy Create free account
hub / github.com/grantjenks/python-sortedcontainers / test_bisect

Function test_bisect

tests/test_coverage_sorteddict.py:339–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337 assert all(temp.index(val) == (99 - val) for val in range(100))
338
339def test_bisect():
340 mapping = [(val, pos) for pos, val in enumerate(string.ascii_lowercase)]
341 temp = SortedDict(mapping)
342 assert temp.bisect_left('a') == 0
343 assert temp.bisect_right('f') == 6
344 assert temp.bisect('f') == 6
345
346def test_bisect_key():
347 temp = SortedDict(modulo, ((val, val) for val in range(100)))

Callers

nothing calls this directly

Calls 4

SortedDictClass · 0.90
bisectMethod · 0.80
bisect_leftMethod · 0.45
bisect_rightMethod · 0.45

Tested by

no test coverage detected