Esempio n. 1
0
 def test_WithDuplicate(self):
     lst = [1, 2, 2, 1, 0, 0, 15, 15]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(sortedList, [0, 0, 1, 1, 2, 2, 15, 15])
Esempio n. 2
0
 def test_BigNumbers(self):
     lst = [135604, 1000000, 45, 78435, 456219832, 2, 546]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(sortedList,
                      [2, 45, 546, 78435, 135604, 1000000, 456219832])
Esempio n. 3
0
 def test_WithZero(self):
     lst = [10, 0]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(sortedList, [0, 10])
Esempio n. 4
0
 def test_TwoUnsorted(self):
     lst = [2, 1]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(sortedList, [1, 2])
Esempio n. 5
0
 def test_TwoSorted(self):
     lst = [1, 2]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(lst, sortedList)
Esempio n. 6
0
 def test_SingleList(self):
     lst = [1]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(lst, sortedList)
Esempio n. 7
0
 def test_EmptyList(self):
     lst = []
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(lst, sortedList)