return function()local w=require(script.Parent.flatten)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \097 \102\108\097\116\116\101\110\101\100 \100\105\099\116\105\111\110\097\114\121",function()local G={hello="\119\111\114\108\100";goodbye={yes="\110\111";no="\121\101\115"}}local b=w(G);(expect(b)).to.be.a("\116\097\098\108\101");(expect(b.hello)).to.equal("\119\111\114\108\100");(expect(b.yes)).to.equal("\110\111");(expect(b.no)).to.equal("\121\101\115")end)it("\115\104\111\117\108\100 \110\111\116 \102\108\097\116\116\101\110 \110\101\115\116\101\100 \100\105\099\116\105\111\110\097\114\105\101\115 \105\102 \100\101\112\116\104 \061 \048",function()local G={hello="\119\111\114\108\100";goodbye={yes="\110\111";no="\121\101\115"}}local b=w(G,0);(expect(b)).to.be.a("\116\097\098\108\101");(expect(b.hello)).to.equal("\119\111\114\108\100");(expect(b.goodbye)).to.equal(G.goodbye)end)it("\115\104\111\117\108\100 \102\108\097\116\116\101\110 \097\115 \100\101\101\112\108\121 \097\115 \112\111\115\115\105\098\108\101",function()local G={hello="\119\111\114\108\100",goodbye={yes="\110\111",no="\121\101\115";maybe={maybe="\111\107";okay={experience="\114\111\098\108\111\120"}}}}local b=w(G);(expect(b)).to.be.a("\116\097\098\108\101");(expect(b.hello)).to.equal("\119\111\114\108\100");(expect(b.yes)).to.equal("\110\111");(expect(b.no)).to.equal("\121\101\115");(expect(b.maybe)).to.equal("\111\107");(expect(b.experience)).to.equal("\114\111\098\108\111\120")end)end
return function()
	local Flatten = require(script.Parent.flatten)

	it("should return a flattened dictionary", function()
		local dictionary = {
			hello = "world",
			goodbye = {
				yes = "no",
				no = "yes",
			},
		}

		local flattened = Flatten(dictionary)

		expect(flattened).to.be.a("table")

		expect(flattened.hello).to.equal("world")
		expect(flattened.yes).to.equal("no")
		expect(flattened.no).to.equal("yes")
	end)

	it("should not flatten nested dictionaries if depth = 0", function()
		local dictionary = {
			hello = "world",
			goodbye = {
				yes = "no",
				no = "yes",
			},
		}

		local flattened = Flatten(dictionary, 0)

		expect(flattened).to.be.a("table")

		expect(flattened.hello).to.equal("world")
		expect(flattened.goodbye).to.equal(dictionary.goodbye)
	end)

	it("should flatten as deeply as possible", function()
		local dictionary = {
			hello = "world",
			goodbye = {
				yes = "no",
				no = "yes",
				maybe = {
					maybe = "ok",
					okay = {
						experience = "roblox",
					},
				},
			},
		}

		local flattened = Flatten(dictionary)

		expect(flattened).to.be.a("table")

		expect(flattened.hello).to.equal("world")
		expect(flattened.yes).to.equal("no")
		expect(flattened.no).to.equal("yes")
		expect(flattened.maybe).to.equal("ok")
		expect(flattened.experience).to.equal("roblox")
	end)
end
