Example #1
0
    def test_heap_sort_1(self, N=1000, fst=-1024, lst=1024):
        xs = [random.randint(fst, lst) for i in range(N)]

        ys = xs.copy()

        h = Heap(xs, reverse=True)

        h.sort()

        assert h.xs == sorted(ys)
Example #2
0
    def test_heap_sort_raises(self):
        h = Heap()

        with pytest.raises(RuntimeError):
            h.sort()