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