return function()local G=require(script.Parent.filter)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \097 \099\111\112\121 \111\102 \116\104\101 \103\105\118\101\110 \097\114\114\097\121 \119\105\116\104 \111\110\108\121 \116\104\101 \101\108\101\109\101\110\116\115 \116\104\097\116 \109\097\116\099\104 \116\104\101 \112\114\101\100\105\099\097\116\101",function()local j={1;2;3}local Z=G(j,function(G)return G%2==0 end);(expect(Z)).to.be.a("\116\097\098\108\101");(expect(Z)).never.to.equal(j);(expect(#Z)).to.equal(1);(expect(Z[1])).to.equal(2)end)it("\115\104\111\117\108\100 \110\111\116 \109\111\100\105\102\121 \116\104\101 \111\114\105\103\105\110\097\108 \097\114\114\097\121",function()local j={1,2,3}local Z=G(j,function(G)return G%2==0 end);(expect(Z)).never.to.equal(j);(expect(j[1])).to.equal(1);(expect(j[2])).to.equal(2);(expect(j[3])).to.equal(3);(expect(Z[1])).to.equal(2)end)end
return function()
	local Filter = require(script.Parent.filter)

	it("should return a copy of the given array with only the elements that match the predicate", function()
		local array = { 1, 2, 3 }

		local new = Filter(array, function(value)
			return value % 2 == 0
		end)

		expect(new).to.be.a("table")
		expect(new).never.to.equal(array)
		expect(#new).to.equal(1)

		expect(new[1]).to.equal(2)
	end)

	it("should not modify the original array", function()
		local array = { 1, 2, 3 }

		local new = Filter(array, function(value)
			return value % 2 == 0
		end)

		expect(new).never.to.equal(array)

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

		expect(new[1]).to.equal(2)
	end)
end
