return function()local d=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local S=d.Packages local E=require(S.Llama)local P=E.List local V=P.update it("\115\104\111\117\108\100 \118\097\108\105\100\097\116\101 \116\121\112\101\115",function()local d={{0};{{};1.5}}for S=1,#d,1 do local E,P=pcall(function()V(unpack(d[S]))end);(expect(string.find(P,"\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 d={};(expect(V(d,1))).never.to.equal(d)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 d={"\102\111\111","\098\097\114"}local S=0 setmetatable(d,{__newindex=function()S=S+1 end})V(d,1,function() end);(expect(S)).to.equal(0)end)it("\115\104\111\117\108\100 \117\112\100\097\116\101 \118\097\108\117\101 \097\116 \115\112\101\099\105\102\105\101\100 \105\110\100\101\120",function()local d={"\102\111\111","\098\097\114"}local S=V(d,2,function(d)return d.."\102\111\111"end);(expect(S[2])).to.equal("\098\097\114\102\111\111")end)it("\115\104\111\117\108\100 \099\097\108\108 \099\097\108\108\098\097\099\107 \105\102 \105\110\100\101\120 \100\111\101\115 \110\111\116 \101\120\105\115\116 \097\110\100 \099\114\101\097\116\101 \101\110\116\114\121 \105\102 \112\114\111\118\105\100\101\100",function()local d={"\102\111\111","\098\097\114"}local S=V(d,3,nil,function()return"\098\097\122"end);(expect(S[3])).to.equal("\098\097\122")end)end
return function()
	local ReplicatedStorage = game:GetService("ReplicatedStorage")

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

	local List = Llama.List
	local update = List.update

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

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

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

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

		expect(update(a, 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,
		})

		update(a, 1, function() end)

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

	it("should update value at specified index", function()
		local a = { "foo", "bar" }

		local b = update(a, 2, function(v)
			return v .. "foo"
		end)

		expect(b[2]).to.equal("barfoo")
	end)

	it("should call callback if index does not exist and create entry if provided", function()
		local a = {
			"foo",
			"bar",
		}

		local b = update(a, 3, nil, function()
			return "baz"
		end)

		expect(b[3]).to.equal("baz")
	end)
end