Пример #1
0
 def test_empty(self):
     arr = []
     res = radix.extended_radix_sort(arr)
     expected = []
     self.assertEqual(expected, res)
Пример #2
0
 def test_sorted_long(self):
     arr = sorted([rand(-1000000, 1000000) for _ in range(1000000)])
     res = radix.extended_radix_sort(arr)
     expected = arr
     self.assertFalse(not res)
     self.assertEqual(expected, res)
Пример #3
0
 def test_multi_rank_length(self):
     arr = [rand(0, 10000) for _ in range(1000)]
     res = radix.extended_radix_sort(arr)
     expected = sorted(arr)
     self.assertFalse(not res)
     self.assertEqual(expected, res)
Пример #4
0
 def test_different_long(self):
     arr = [rand(-1000000, 1000000) for _ in range(1000000)]
     res = radix.extended_radix_sort(arr)
     expected = sorted(arr)
     self.assertFalse(not res)
     self.assertEqual(expected, res)
Пример #5
0
 def test_trivial(self):
     arr = [33, 22, 11, 0]
     res = radix.extended_radix_sort(arr)
     expected = [0, 11, 22, 33]
     self.assertFalse(not res)
     self.assertEqual(expected, res)