return function()local i=require(script.Parent.flatten)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \097 \102\108\097\116\116\101\110\101\100 \097\114\114\097\121",function()local p={1,2,{3,4}}local y=i(p);(expect(y)).to.be.a("\116\097\098\108\101");(expect(#y)).to.equal(4);(expect(y[1])).to.equal(1);(expect(y[2])).to.equal(2);(expect(y[3])).to.equal(3);(expect(y[4])).to.equal(4)end)it("\115\104\111\117\108\100 \110\111\116 \102\108\097\116\116\101\110 \110\101\115\116\101\100 \097\114\114\097\121\115 \105\102 \100\101\112\116\104 \061 \048",function()local p={1,2,{3,4}}local y=i(p,0);(expect(y)).to.be.a("\116\097\098\108\101");(expect(#y)).to.equal(3);(expect(y[1])).to.equal(1);(expect(y[2])).to.equal(2);(expect(y[3])).to.equal(p[3])end)it("\115\104\111\117\108\100 \102\108\097\116\116\101\110 \097\115 \100\101\101\112\108\121 \097\115 \112\111\115\115\105\098\108\101",function()local p={1;2,{3,4;{5,6;{7,8}}}}local y=i(p);(expect(y)).to.be.a("\116\097\098\108\101");(expect(#y)).to.equal(8);(expect(y[1])).to.equal(1);(expect(y[2])).to.equal(2);(expect(y[3])).to.equal(3);(expect(y[4])).to.equal(4);(expect(y[5])).to.equal(5);(expect(y[6])).to.equal(6);(expect(y[7])).to.equal(7);(expect(y[8])).to.equal(8)end)end
return function()
	local Flatten = require(script.Parent.flatten)

	it("should return a flattened array", function()
		local array = { 1, 2, { 3, 4 } }

		local flattened = Flatten(array)

		expect(flattened).to.be.a("table")
		expect(#flattened).to.equal(4)

		expect(flattened[1]).to.equal(1)
		expect(flattened[2]).to.equal(2)
		expect(flattened[3]).to.equal(3)
		expect(flattened[4]).to.equal(4)
	end)

	it("should not flatten nested arrays if depth = 0", function()
		local array = { 1, 2, { 3, 4 } }

		local flattened = Flatten(array, 0)

		expect(flattened).to.be.a("table")
		expect(#flattened).to.equal(3)

		expect(flattened[1]).to.equal(1)
		expect(flattened[2]).to.equal(2)
		expect(flattened[3]).to.equal(array[3])
	end)

	it("should flatten as deeply as possible", function()
		local array = { 1, 2, { 3, 4, { 5, 6, { 7, 8 } } } }

		local flattened = Flatten(array)

		expect(flattened).to.be.a("table")
		expect(#flattened).to.equal(8)

		expect(flattened[1]).to.equal(1)
		expect(flattened[2]).to.equal(2)
		expect(flattened[3]).to.equal(3)
		expect(flattened[4]).to.equal(4)
		expect(flattened[5]).to.equal(5)
		expect(flattened[6]).to.equal(6)
		expect(flattened[7]).to.equal(7)
		expect(flattened[8]).to.equal(8)
	end)
end
