def test_radix(self): retlist = radixsort.sort(self.unsorted) self.assertEqual(retlist, self.expected)
def test_sortSameNumber(self): A = [1, 1, 1, 1, 1, 1, 1, 1] self.assertSequenceEqual(algorithm.sort(A), [1, 1, 1, 1, 1, 1, 1, 1])
def test_sortWithDuplicates(self): A = [5, -6, 3, 1, 8, 3, 2] self.assertSequenceEqual(algorithm.sort(A), [-6, 1, 2, 3, 3, 5, 8])
def test_sortFewSortedElements(self): A = [1, 5, 6, 88, 104, 999, 500, 700, 600, -456] self.assertSequenceEqual(algorithm.sort(A), [-456, 1, 5, 6, 88, 104, 500, 600, 700, 999])
def test_sortFewUnsortedElements(self): A = [3, 45, 1, 2, 8, 992, 9, 11, 109] self.assertSequenceEqual(algorithm.sort(A), [1, 2, 3, 8, 9, 11, 45, 109, 992])
def do_radixsort(strings): return radixsort.sort(strings)