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