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.None local V=E.Set local f=V.toList it("\115\104\111\117\108\100 \118\097\108\105\100\097\116\101 \116\121\112\101\115",function()local d,S=pcall(function()f(0)end);(expect(string.find(S,"\101\120\112\101\099\116\101\100\044 \103\111\116"))).to.be.ok()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={foo=true,bar=true;baz=true}local S=0 setmetatable(d,{__newindex=function()S=S+1 end})f(d);(expect(S)).to.equal(0)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\104\101 \099\111\114\114\101\099\116 \118\097\108\117\101\115",function()local d={foo=true;bar=true,baz=true}local S={foo=1,bar=1,baz=1}local E=f(d);(expect(#E)).to.equal(3)for d,E in ipairs(E)do(expect(S[E])).to.be.ok()S[E]=S[E]-1 end for d,S in pairs(S)do(expect(S)).to.equal(0)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 d=f({});(expect(next(d))).never.to.be.ok()end)it("\115\104\111\117\108\100 \099\111\110\116\097\105\110 \097 \078\111\110\101 \101\108\101\109\101\110\116 \105\102 \116\104\101\114\101 \105\115 \097 \078\111\110\101 \107\101\121 \105\110 \116\104\101 \115\101\116",function()local d={[P]=true,bar=true}local S={[P]=1;bar=1}local E=f(d);(expect(#E)).to.equal(2)for d,E in ipairs(E)do(expect(S[E])).to.be.ok()S[E]=S[E]-1 end for d,S in pairs(S)do(expect(S)).to.equal(0)end end)end
return function()
	local ReplicatedStorage = game:GetService("ReplicatedStorage")

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

	local None = Llama.None

	local Set = Llama.Set
	local toList = Set.toList

	it("should validate types", function()
		local _, err = pcall(function()
			toList(0)
		end)

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

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

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

		toList(a)

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

	it("should return the correct values", function()
		local a = {
			foo = true,
			bar = true,
			baz = true,
		}
		local keyCount = {
			foo = 1,
			bar = 1,
			baz = 1,
		}
		local b = toList(a)

		expect(#b).to.equal(3)

		for _, key in ipairs(b) do
			expect(keyCount[key]).to.be.ok()
			keyCount[key] = keyCount[key] - 1
		end

		for _, count in pairs(keyCount) do
			expect(count).to.equal(0)
		end
	end)

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

		expect(next(a)).never.to.be.ok()
	end)

	it("should contain a None element if there is a None key in the set", function()
		local a = {
			[None] = true,
			bar = true
		}
		local keyCount = {
			[None] = 1,
			bar = 1
		}
		local b = toList(a)

		expect(#b).to.equal(2)

		for _, key in ipairs(b) do
			expect(keyCount[key]).to.be.ok()
			keyCount[key] = keyCount[key] - 1
		end
		
		for _, count in pairs(keyCount) do
			expect(count).to.equal(0)
		end
	end)
end