Skip to content

Commit de4c55a

Browse files
ElissaElissa
authored andcommitted
Update project/tests.py
1 parent 753d00b commit de4c55a

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎project/tests.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,25 @@ def test_insertion(self):
5454
self.assertEqual(insertion_sort(arr2), [])
5555
self.assertEqual(insertion_sort(arr3), [0,1,2,3,4,5])
5656

57+
58+
def test_bubble(self):
59+
arr1 = [1, 5, 8, 4, 2, 9, 6, 0, 3, 7]
60+
arr2 = []
61+
arr3 = [0, 1, 2, 3, 4, 5]
62+
63+
self.assertEqual(bubble_sort(arr1), [0,1,2,3,4,5,6,7,8,9])
64+
self.assertEqual(bubble_sort(arr2), [])
65+
self.assertEqual(bubble_sort(arr3), [0,1,2,3,4,5])
66+
67+
68+
def test_count(self):
69+
arr1 = [1, 5, 8, 4, 2, 9, 6, 0, 3, 7]
70+
arr2 = []
71+
arr3 = [1, 5, -2, 4, 3]
72+
73+
self.assertEqual(count_sort(arr1), [0,1,2,3,4,5,6,7,8,9])
74+
self.assertEqual(count_sort(arr2), [])
75+
self.assertEqual(count_sort(arr3), "Error, negative numbers not allowed in Count Sort")
76+
5777
if __name__ == '__main__':
5878
unittest.main()

0 commit comments

Comments
 (0)