Esempio n. 1
0
 def test_bubble_sort_reflexive(self):
     assert bubble_sort(bubble_sort(self.standard_list)) == bubble_sort(self.standard_list)
     assert bubble_sort(bubble_sort(self.negative_list)) == bubble_sort(self.negative_list)
     assert bubble_sort(bubble_sort([])) == bubble_sort([])
Esempio n. 2
0
 def test_bubble_sort_functionality(self):
     assert bubble_sort(self.standard_list) == sorted(self.standard_list)
     assert bubble_sort(self.negative_list) == sorted(self.negative_list)
Esempio n. 3
0
 def test_bubble_sort_edge_cases(self):
     assert bubble_sort([]) == sorted([])
     assert bubble_sort([0]) == sorted([0])
     assert bubble_sort([0, 0]) == sorted([0, 0])
     assert bubble_sort([0, 0, 0]) == sorted([0, 0, 0])