コード例 #1
0
ファイル: test.py プロジェクト: BaylorBower/sortingTests
 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])
コード例 #2
0
ファイル: test.py プロジェクト: BaylorBower/sortingTests
 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])
コード例 #3
0
ファイル: test.py プロジェクト: BaylorBower/sortingTests
 def test_WithZero(self):
     lst = [10, 0]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(sortedList, [0, 10])
コード例 #4
0
ファイル: test.py プロジェクト: BaylorBower/sortingTests
 def test_TwoUnsorted(self):
     lst = [2, 1]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(sortedList, [1, 2])
コード例 #5
0
ファイル: test.py プロジェクト: BaylorBower/sortingTests
 def test_TwoSorted(self):
     lst = [1, 2]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(lst, sortedList)
コード例 #6
0
ファイル: test.py プロジェクト: BaylorBower/sortingTests
 def test_SingleList(self):
     lst = [1]
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(lst, sortedList)
コード例 #7
0
ファイル: test.py プロジェクト: BaylorBower/sortingTests
 def test_EmptyList(self):
     lst = []
     sortedList = lst
     cocktailSort(sortedList)
     self.assertEqual(lst, sortedList)