diff --git a/test_insertion_sort01.py b/test_insertion_sort01.py index 47291ee..baff970 100644 --- a/test_insertion_sort01.py +++ b/test_insertion_sort01.py @@ -1,3 +1,4 @@ +import random import unittest import insertion_sort01 @@ -14,6 +15,26 @@ class Test(unittest.TestCase): self.assertEqual(expected, a) + def test_big_example(self): + tmpl = list(range(0, 1000)) + a = tmpl[:] + random.shuffle(a) + expected = tmpl[:] + + insertion_sort01.insertion_sort(a) + + self.assertEqual(expected, a) + + def test_bigger_example(self): + tmpl = list(range(0, 10000)) + a = tmpl[:] + random.shuffle(a) + expected = tmpl[:] + + insertion_sort01.insertion_sort(a) + + self.assertEqual(expected, a) + if __name__ == '__main__': unittest.main()