return function()local C=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local q=C.Packages local t=require(q.Llama)local O=t.None local G=t.Dictionary local J=G.mergeDeep it("\115\104\111\117\108\100 \118\097\108\105\100\097\116\101 \116\121\112\101\115",function()local C={{0};{{},0}}for q=1,#C,1 do local t,O=pcall(function()J(unpack(C[q]))end);(expect(string.find(O,"\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 C={};(expect(J(C))).never.to.equal(C)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 C=0 local q=0 local t={}local O={foo="\102\111\111-\098"}setmetatable(t,{__newindex=function()C=C+1 end})setmetatable(O,{__newindex=function()q=q+1 end})J(t,O);(expect(C)).to.equal(0);(expect(q)).to.equal(0)end)it("\115\104\111\117\108\100 \109\101\114\103\101 \116\097\098\108\101\115\044 \111\118\101\114\119\114\105\116\105\110\103 \112\114\101\118\105\111\117\115 \118\097\108\117\101\115",function()local C={foo="\102\111\111-\097";bar="\098\097\114-\097"}local q={foo="\102\111\111-\098",baz="\098\097\122-\098"}local t=J(C,q);(expect(t.foo)).to.equal(q.foo);(expect(t.bar)).to.equal(C.bar);(expect(t.baz)).to.equal(q.baz)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \078\111\110\101 \118\097\108\117\101\115",function()local C={foo="\102\111\111-\097"}local q={foo=O}local t=J(C,q);(expect(t.foo)).never.to.be.ok()end)it("\115\104\111\117\108\100 \097\099\099\101\112\116 \097\114\098\105\116\114\097\114\121 \110\117\109\098\101\114\115 \111\102 \116\097\098\108\101\115",function()local C={foo="\102\111\111-\097"}local q={bar="\098\097\114-\098"}local t={baz="\098\097\122-\099"}local O=J(C,q,t);(expect(O.foo)).to.equal(C.foo);(expect(O.bar)).to.equal(q.bar);(expect(O.baz)).to.equal(t.baz)end)it("\115\104\111\117\108\100 \097\099\099\101\112\116 \122\101\114\111 \116\097\098\108\101\115",function()(expect(J())).to.be.a("\116\097\098\108\101")end)it("\115\104\111\117\108\100 \097\099\099\101\112\116 \104\111\108\101\115 \105\110 \097\114\103\117\109\101\110\116\115",function()local C={foo="\102\111\111-\097"}local q={bar="\098\097\114-\098"}local t=J(C,nil,q);(expect(t.foo)).to.equal(C.foo);(expect(t.bar)).to.equal(q.bar)local O=J(nil,C,q);(expect(O.foo)).to.equal(C.foo);(expect(O.bar)).to.equal(q.bar)end)it("\115\104\111\117\108\100 \109\101\114\103\101 \116\097\098\108\101\115 \097\110\100 \115\117\098\116\097\098\108\101\115",function()local C={foo="\102\111\111-\097";foobar={bar="\098\097\114-\097";barbaz={baz="\098\097\122-\097"}}}local q={foo="\102\111\111-\098";foobar={bar="\098\097\114-\098",barbaz={baz="\098\097\122-\098"}}}local t=J(C,q);(expect(t.foo)).to.equal(q.foo);(expect(t.foobar)).never.to.equal(C.foobar);(expect(t.foobar)).never.to.equal(q.foobar);(expect(t.foobar.bar)).to.equal(q.foobar.bar);(expect(t.foobar.barbaz)).never.to.equal(C.foobar.barbaz);(expect(t.foobar.barbaz)).never.to.equal(q.foobar.barbaz);(expect(t.foobar.barbaz.baz)).to.equal(q.foobar.barbaz.baz)end)end
return function()
	local ReplicatedStorage = game:GetService("ReplicatedStorage")

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

	local None = Llama.None

	local Dictionary = Llama.Dictionary
	local mergeDeep = Dictionary.mergeDeep

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

		for i = 1, #args do
			local _, err = pcall(function()
				mergeDeep(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(mergeDeep(a)).never.to.equal(a)
	end)

	it("should not mutate passed in tables", function()
		local mutationsA = 0
		local mutationsB = 0

		local a = {}
		local b = {
			foo = "foo-b",
		}

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

		setmetatable(b, {
			__newindex = function()
				mutationsB = mutationsB + 1
			end,
		})

		mergeDeep(a, b)

		expect(mutationsA).to.equal(0)
		expect(mutationsB).to.equal(0)
	end)

	it("should merge tables, overwriting previous values", function()
		local a = {
			foo = "foo-a",
			bar = "bar-a",
		}

		local b = {
			foo = "foo-b",
			baz = "baz-b",
		}

		local c = mergeDeep(a, b)

		expect(c.foo).to.equal(b.foo)
		expect(c.bar).to.equal(a.bar)
		expect(c.baz).to.equal(b.baz)
	end)

	it("should remove None values", function()
		local a = {
			foo = "foo-a",
		}

		local b = {
			foo = None,
		}

		local c = mergeDeep(a, b)

		expect(c.foo).never.to.be.ok()
	end)

	it("should accept arbitrary numbers of tables", function()
		local a = {
			foo = "foo-a",
		}

		local b = {
			bar = "bar-b",
		}

		local c = {
			baz = "baz-c",
		}

		local d = mergeDeep(a, b, c)

		expect(d.foo).to.equal(a.foo)
		expect(d.bar).to.equal(b.bar)
		expect(d.baz).to.equal(c.baz)
	end)

	it("should accept zero tables", function()
		expect(mergeDeep()).to.be.a("table")
	end)

	it("should accept holes in arguments", function()
		local a = {
			foo = "foo-a",
		}

		local b = {
			bar = "bar-b",
		}

		local c = mergeDeep(a, nil, b)

		expect(c.foo).to.equal(a.foo)
		expect(c.bar).to.equal(b.bar)

		local d = mergeDeep(nil, a, b)

		expect(d.foo).to.equal(a.foo)
		expect(d.bar).to.equal(b.bar)
	end)

	it("should merge tables and subtables", function()
		local a = {
			foo = "foo-a",
			foobar = {
				bar = "bar-a",
				barbaz = {
					baz = "baz-a"
				}
			}
		}

		local b = {
			foo = "foo-b",
			foobar = {
				bar = "bar-b",
				barbaz = {
					baz = "baz-b"
				}
			}
		}

		local c = mergeDeep(a, b)

		expect(c.foo).to.equal(b.foo)
		expect(c.foobar).never.to.equal(a.foobar)
		expect(c.foobar).never.to.equal(b.foobar)
		expect(c.foobar.bar).to.equal(b.foobar.bar)
		expect(c.foobar.barbaz).never.to.equal(a.foobar.barbaz)
		expect(c.foobar.barbaz).never.to.equal(b.foobar.barbaz)
		expect(c.foobar.barbaz.baz).to.equal(b.foobar.barbaz.baz)
	end)
end