return function()local p=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local s=p.Packages local P=require(s.Llama)local k=P.List local J=k.splice it("\115\104\111\117\108\100 \118\097\108\105\100\097\116\101 \116\121\112\101\115",function()local p={{0},{{};1.5;6.9}}for s=1,#p,1 do local P,k=pcall(function()J(unpack(p[s]))end);(expect(string.find(k,"\101\120\112\101\099\116\101\100\044 \103\111\116"))).to.be.ok()end end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \097 \110\101\119 \116\097\098\108\101",function()local p={1,2,3};(expect(J(p,1,1,1))).never.to.equal(p)end)it("\115\104\111\117\108\100 \110\111\116 \109\117\116\097\116\101 \112\097\115\115\101\100 \105\110 \116\097\098\108\101\115",function()local p={"\102\111\111","\098\097\114"}local s=0 setmetatable(p,{__newindex=function()s=s+1 end})J(p);(expect(s)).to.equal(0)end)it("\115\104\111\117\108\100 \116\104\114\111\119 \119\104\101\110 \116\104\101 \115\116\097\114\116 \105\110\100\101\120 \105\115 \104\105\103\104\101\114 \116\104\097\110 \116\104\101 \101\110\100 \105\110\100\101\120",function()local p={5,8,7,2;3,7};(expect(function()J(p,4,1)end)).to.throw()end)it("\115\104\111\117\108\100 \114\101\112\108\097\099\101 \097\110\100 \105\110\115\101\114\116 \118\097\108\117\101\115",function()local p={1,2;3;9;8,7;8}local s=J(p,4,5,4,5,6)for p,s in pairs(s)do(expect(p)).to.equal(s)end end)it("\115\104\111\117\108\100 \119\111\114\107 \119\105\116\104 \097\110 \101\109\112\116\121 \116\097\098\108\101",function()local p=J({});(expect(p)).to.be.a("\116\097\098\108\101");(expect(#p)).to.equal(0)end)end
return function()
	local ReplicatedStorage = game:GetService("ReplicatedStorage")

	local Packages = ReplicatedStorage.Packages
	local Llama = require(Packages.Llama)

	local List = Llama.List
	local splice = List.splice

	it("should validate types", function()
		local args = {
			{ 0 },
			{ {}, 1.5, 6.9 },
		}

		for i = 1, #args do
			local _, err = pcall(function()
				splice(unpack(args[i]))
			end)

			expect(string.find(err, "expected, got")).to.be.ok()
		end
	end)

	it("should return a new table", function()
		local a = { 1, 2, 3 }

		expect(splice(a, 1, 1, 1)).never.to.equal(a)
	end)

	it("should not mutate passed in tables", function()
		local a = { "foo", "bar" }
		local mutations = 0

		setmetatable(a, {
			__newindex = function()
				mutations = mutations + 1
			end,
		})

		splice(a)

		expect(mutations).to.equal(0)
	end)

	it("should throw when the start index is higher than the end index", function()
		local a = { 5, 8, 7, 2, 3, 7 }

		expect(function()
			splice(a, 4, 1)
		end).to.throw()
	end)

	it("should replace and insert values", function()
		local a = { 1, 2, 3, 9, 8, 7, 8 }
		local b = splice(a, 4, 5, 4, 5, 6)

		for k, v in pairs(b) do
			expect(k).to.equal(v)
		end
	end)

	it("should work with an empty table", function()
		local a = splice({})

		expect(a).to.be.a("table")
		expect(#a).to.equal(0)
	end)
end