コード例 #1
0
    def test_largest_sum_mix(self):

        input = [1, 5, -100, 4, 7]
        result = largest_sum(input)
        expected = 11
        self.assertEqual(expected, result)
コード例 #2
0
    def test_largest_empty(self):

        input = []
        result = largest_sum(input)
        expected = 0
        self.assertEqual(expected, result)
コード例 #3
0
    def test_largest_sum_all_pos(self):

        input = [1, 5, 8, 4, 7]
        result = largest_sum(input)
        expected = 25
        self.assertEqual(expected, result)
コード例 #4
0
    def test_largest_sum_neg(self):

        input = [-1, -3, -4]
        result = largest_sum(input)
        expected = -1
        self.assertEqual(expected, result)