def test_CompleteAllNegative(): A = [-3, -25, -1, -16, -23, -7, -5, -22] maxLeft, maxRight, total = maxSubarrayDivide.findMaxSubarray(A, 0, 7) assert maxLeft == 2 assert maxRight == 2 assert total == -1
def test_CompleteOneElement(): A = [13, -3, -25, 20, -3, -16, -23, 18, 20 , -7, 12, -5, -22, 15, -4, 7] maxLeft, maxRight, total = maxSubarrayDivide.findMaxSubarray(A, 0, 0) assert maxLeft == 0 assert maxRight == 0 assert total == 13
def test_CompleteWholeArray(): A = [13, -3, -25, 20, -3, -16, -23, 18, 20 , -7, 12, -5, -22, 15, -4, 7] maxLeft, maxRight, total = maxSubarrayDivide.findMaxSubarray(A, 0, 15) assert maxLeft == 7 assert maxRight == 10 assert total == 43