def test_reduce(self):
        res = _([1, 2, 3, 4, 5, 6]).reduce(
            lambda sum, num, *args: sum + num, 0)
        self.assertEqual(21, res, "did not reduced correctly")
        # alias
        res = _([1, 2, 3, 4, 5, 6]).foldl(lambda sum, num, *args: sum + num, 0)
        self.assertEqual(21, res, "did not foldl correctly")
        # alias
        res = _([1, 2, 3, 4, 5, 6]).inject(
            lambda sum, num, *args: sum + num, 0)
        self.assertEqual(21, res, "did not inject correctly")
dataset/ETHPy150Open serkanyersen/underscore.py/tests/test_collections.py/TestCollections.test_reduce/original