コード例 #1
0
ファイル: test_pivot.py プロジェクト: spacenut/collect
 def test_ninther_median_pivot_normal(self):
     l1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
     res = sort.ninther_pivot(l1)
     expect = 4
     self.assertEqual(res, expect,
                      "the pivot of %s is %s expected: %s" %
                      (l1, res, expect))
コード例 #2
0
ファイル: test_pivot.py プロジェクト: spacenut/collect
 def test_ninther_median_pivot_fallback(self):
     l1 = [1, 2, 3, 4, 5, 6, 7]
     res = sort.ninther_pivot(l1)
     expect = 3
     self.assertEqual(res, expect,
                      "the pivot of %s is %s expected: %s" %
                      (l1, res, expect))
コード例 #3
0
ファイル: test_pivot.py プロジェクト: spacenut/collect
 def test_ninther_median_pivot_empty(self):
     l1 = []
     res = sort.ninther_pivot(l1)
     expect = None
     self.assertEqual(res, expect,
                      "the pivot of %s is %s expected: %s" %
                      (l1, res, expect))
コード例 #4
0
 def test_ninther_median_pivot_normal(self):
     l1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
     res = sort.ninther_pivot(l1)
     expect = 4
     self.assertEqual(
         res, expect,
         "the pivot of %s is %s expected: %s" % (l1, res, expect))
コード例 #5
0
 def test_ninther_median_pivot_fallback(self):
     l1 = [1, 2, 3, 4, 5, 6, 7]
     res = sort.ninther_pivot(l1)
     expect = 3
     self.assertEqual(
         res, expect,
         "the pivot of %s is %s expected: %s" % (l1, res, expect))
コード例 #6
0
 def test_ninther_median_pivot_empty(self):
     l1 = []
     res = sort.ninther_pivot(l1)
     expect = None
     self.assertEqual(
         res, expect,
         "the pivot of %s is %s expected: %s" % (l1, res, expect))