return function()local i=require(script.Parent.reduce)it("\115\104\111\117\108\100 \114\101\100\117\099\101 \116\104\101 \103\105\118\101\110 \097\114\114\097\121 \116\111 \097 \115\105\110\103\108\101 \118\097\108\117\101",function()local p={1,2,3}local y=i(p,function(i,p)return i+p end,0);(expect(y)).to.equal(6)end)it("\115\104\111\117\108\100 \114\101\100\117\099\101 \116\104\101 \103\105\118\101\110 \097\114\114\097\121 \116\111 \097 \115\105\110\103\108\101 \118\097\108\117\101\044 \117\115\105\110\103 \116\104\101 \102\105\114\115\116 \101\108\101\109\101\110\116 \097\115 \116\104\101 \105\110\105\116\105\097\108 \118\097\108\117\101",function()local p={1,2,3}local y=i(p,function(i,p)return i-p end);(expect(y)).to.equal(-4)end)end
return function()
	local Reduce = require(script.Parent.reduce)

	it("should reduce the given array to a single value", function()
		local array = { 1, 2, 3 }

		local reduced = Reduce(array, function(accumulator, value)
			return accumulator + value
		end, 0)

		expect(reduced).to.equal(6)
	end)

	it("should reduce the given array to a single value, using the first element as the initial value", function()
		local array = { 1, 2, 3 }

		local reduced = Reduce(array, function(accumulator, value)
			return accumulator - value
		end)

		expect(reduced).to.equal(-4)
	end)
end
