def test_getitem():
    random.seed(0)
    slt = SortedList(load=17)

    lst = list()

    for rpt in range(100):
        val = random.random()
        slt.add(val)
        lst.append(val)

    lst.sort()

    assert all(slt[idx] == lst[idx] for idx in range(100))
    assert all(slt[idx - 99] == lst[99 - idx] for idx in range(100))
dataset/ETHPy150Open grantjenks/sorted_containers/tests/test_coverage_sortedlist.py/test_getitem/swapped operands of `-`