return function()local b=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local Q=b.Packages local o=require(Q.Llama)local F=o.Dictionary local O=F.count it("\115\104\111\117\108\100 \118\097\108\105\100\097\116\101 \116\121\112\101\115",function()local b={{0},{{};0},{0,function() end}}for Q=1,#b,1 do local o,F=pcall(function()O(unpack(b[Q]))end);(expect(string.find(F,"\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\117\109\098\101\114",function()(expect(O({}))).to.be.a("\110\117\109\098\101\114")end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \110\117\109\098\101\114 \111\102 \101\110\116\114\105\101\115 \101\118\101\110 \119\105\116\104\111\117\116 \097 \112\114\101\100\105\099\097\116\101",function()local b={foo=1;bar=2,baz=3};(expect(O(b))).to.equal(3)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \110\117\109\098\101\114 \111\102 \101\110\116\114\105\101\115 \116\104\097\116 \112\097\115\115 \103\105\118\101\110 \112\114\101\100\105\099\097\116\101",function()local b={foo=1;bar=2,baz=3,qux=3}local function Q(b)return b==3 end;(expect(O(b,Q))).to.equal(2)end)it("\115\104\111\117\108\100 \112\114\111\118\105\100\101 \101\097\099\104 \118\097\108\117\101 \097\110\100 \107\101\121 \116\111 \116\104\101 \112\114\101\100\105\099\097\116\101",function()local b={foo=1}local function Q(Q,o)(expect(Q)).to.equal(b.foo);(expect(o)).to.equal("\102\111\111")end O(b,Q)end)it("\115\104\111\117\108\100 \099\097\108\108 \116\104\101 \112\114\101\100\105\099\097\116\101 \102\111\114 \101\097\099\104 \118\097\108\117\101",function()local b={foo=1,bar=2,baz=3}local Q=0 local function o()Q=Q+1 end O(b,o);(expect(Q)).to.equal(3)end)it("\115\104\111\117\108\100 \119\111\114\107 \119\105\116\104 \101\109\112\116\121 \116\097\098\108\101\115",function()(expect(O({}))).to.equal(0)end)end
return function()
	local ReplicatedStorage = game:GetService("ReplicatedStorage")

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

	local Dictionary = Llama.Dictionary
	local count = Dictionary.count

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

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

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

	it("should return a number", function()
		expect(count({})).to.be.a("number")
	end)

	it("should return number of entries even without a predicate", function()
		local a = {
			foo = 1,
			bar = 2,
			baz = 3,
		}

		expect(count(a)).to.equal(3)
	end)

	it("should return number of entries that pass given predicate", function()
		local a = {
			foo = 1,
			bar = 2,
			baz = 3,
			qux = 3,
		}

		local function only3s(v)
			return v == 3
		end

		expect(count(a, only3s)).to.equal(2)
	end)

	it("should provide each value and key to the predicate", function()
		local a = {
			foo = 1,
		}

		local function predicate(v, k)
			expect(v).to.equal(a.foo)
			expect(k).to.equal("foo")
		end

		count(a, predicate)
	end)

	it("should call the predicate for each value", function()
		local a = {
			foo = 1,
			bar = 2,
			baz = 3,
		}
		local callCount = 0

		local function counter()
			callCount = callCount + 1
		end

		count(a, counter)

		expect(callCount).to.equal(3)
	end)

	it("should work with empty tables", function()
		expect(count({})).to.equal(0)
	end)
end