예제 #1
0
 def testBLSortEmpty(self):
     self.assertEqual(hw.blsort([]), [])
예제 #2
0
 def testBLSortTwoElementsBackward(self):
     self.assertEqual(hw.blsort([1, 0]), [0, 1])
예제 #3
0
 def testBLSortOneOne(self):
     self.assertEqual(hw.blsort([1]), [1])
예제 #4
0
 def testBLSortRandom(self):
     self.assertEqual(hw.blsort([0, 1, 1, 0, 1, 1]), [0, 0, 1, 1, 1, 1])
예제 #5
0
 def testBLSortZerosSurroundedByOnes(self):
     self.assertEqual(hw.blsort([1] + [0] * 10 + [1]), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1])
예제 #6
0
 def testBLSortZerosSurroundedByOnes(self):
     self.assertEqual(hw.blsort([1] + [0] * 10 + [1]),
                      [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1])
예제 #7
0
 def testBLSortRandom(self):
     self.assertEqual(hw.blsort([0, 1, 1, 0, 1, 1]), [0, 0, 1, 1, 1, 1])
예제 #8
0
 def testBLSortEmpty(self):
     self.assertEqual(hw.blsort([]), [])
예제 #9
0
 def testBLSortOneOne(self):
     self.assertEqual(hw.blsort([1]), [1])
예제 #10
0
 def testBLSortTwoElementsBackward(self):
     self.assertEqual(hw.blsort([1, 0]), [0, 1])