return function()local i=require(script.Parent.find)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\104\101 \102\105\114\115\116 \101\108\101\109\101\110\116 \116\104\097\116 \109\097\116\099\104\101\115 \116\104\101 \103\105\118\101\110 \118\097\108\117\101",function()local p={1,2,3};(expect(i(p,2))).to.equal(2)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \110\105\108 \105\102 \110\111 \101\108\101\109\101\110\116 \109\097\116\099\104\101\115 \116\104\101 \103\105\118\101\110 \118\097\108\117\101",function()local p={1,2,3};(expect(i(p,4))).never.to.be.ok()end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\104\101 \102\105\114\115\116 \101\108\101\109\101\110\116 \116\104\097\116 \109\097\116\099\104\101\115\044 \103\105\118\101\110 \097 \115\116\097\114\116\105\110\103 \105\110\100\101\120",function()local p={1,2;3};(expect(i(p,3,2))).to.equal(3)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \110\105\108 \105\102 \110\111 \101\108\101\109\101\110\116 \109\097\116\099\104\101\115\044 \103\105\118\101\110 \097 \115\116\097\114\116\105\110\103 \105\110\100\101\120",function()local p={1,2;3};(expect(i(p,1,2))).never.to.be.ok()end)it("\115\104\111\117\108\100 \097\099\099\101\112\116 \097 \110\101\103\097\116\105\118\101 \115\116\097\114\116\105\110\103 \105\110\100\101\120",function()local p={1,2,3};(expect(i(p,2,-1))).to.equal(2)end)end
return function()
	local Find = require(script.Parent.find)

	it("should return the first element that matches the given value", function()
		local array = { 1, 2, 3 }

		expect(Find(array, 2)).to.equal(2)
	end)

	it("should return nil if no element matches the given value", function()
		local array = { 1, 2, 3 }

		expect(Find(array, 4)).never.to.be.ok()
	end)

	it("should return the first element that matches, given a starting index", function()
		local array = { 1, 2, 3 }

		expect(Find(array, 3, 2)).to.equal(3)
	end)

	it("should return nil if no element matches, given a starting index", function()
		local array = { 1, 2, 3 }

		expect(Find(array, 1, 2)).never.to.be.ok()
	end)

	it("should accept a negative starting index", function()
		local array = { 1, 2, 3 }

		expect(Find(array, 2, -1)).to.equal(2)
	end)
end
