Skip to content
Snippets Groups Projects
Commit 8245da30 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

test for heap

parent 11361809
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,13 @@ class TestTimeBasedHeap(unittest.TestCase): ...@@ -22,6 +22,13 @@ class TestTimeBasedHeap(unittest.TestCase):
class TestHeap(unittest.TestCase): class TestHeap(unittest.TestCase):
def test_tbh_iter(self):
tbh = Heap([(10, 'ala'), (20, 'ma'), (30, 'kota'), (5, 'yo')])
self.assertEqual([(5, 'yo'), (10, 'ala'), (20, 'ma'), (30, 'kota')], list(tbh.iter_ascending()))
self.assertEqual(reversed([(5, 'yo'), (10, 'ala'), (20, 'ma'), (30, 'kota')]), list(tbh.iter_descending()))
def test_tbh(self): def test_tbh(self):
tbh = Heap() tbh = Heap()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment