Beispiel #1
0
 def testAlmostAllNegs(self):
     toReverse = BlockReverse()
     reversed = toReverse.block_reverse([-1,2,-1,-1,-1])
     if reversed == [-1,-1,-1,2,-1]:
         pass
     else:
         raise AssertionError
Beispiel #2
0
 def testListMultBlocks(self):
     toReverse = BlockReverse()
     reversed = toReverse.block_reverse([3,2,-1,1,3, -1 ,5, 8, 7, -1, 3, 4])
     if reversed == [3, 4,-1, 5, 8, 7, -1 , 1,3,-1,3,2]:
         pass
     else:
         raise AssertionError
Beispiel #3
0
 def testNoNegs(self):
     toReverse = BlockReverse()
     reversed = toReverse.block_reverse([1,3,5,3,2])
     if reversed == [1,3,5,3,2]:
         pass
     else:
         raise AssertionError
Beispiel #4
0
 def testList(self):
     toReverse = BlockReverse()
     reversed = toReverse.block_reverse([1,3,5,-1,3,2])
     if reversed == [3,2,-1,1,3,5]:
         pass
     else:
         raise AssertionError