Example #1
0
 def test_sort_inverted_list(self):
     input = range(100)
     input.reverse()
     selection_sort.sort(input)
     self.assertEqual(range(100), input)
Example #2
0
 def test_sort_two_elements_list(self):
     input = range(2)
     random.shuffle(input)
     selection_sort.sort(input)
     self.assertEqual(range(2), input)
Example #3
0
 def test_sort_empty_list(self):
     input = range(0)
     selection_sort.sort(input)
     self.assertEqual(range(0), input)
Example #4
0
 def test_sort_one_element_list(self):
     input = range(1)
     selection_sort.sort(input)
     self.assertEqual(range(1), input)
Example #5
0
 def test_sort(self):
     input = range(100)
     random.shuffle(input)
     selection_sort.sort(input)
     self.assertEqual(range(100), input)