return function()local Q=require(script.Parent.Draft)local n=require(script.Parent.makeDraftSafe)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \097 \100\114\097\102\116-\115\097\102\101 \118\101\114\115\105\111\110 \111\102 \116\104\101 \103\105\118\101\110 \102\117\110\099\116\105\111\110",function()local function u(Q,n,u)rawset(Q,n,u)end local y=Q.new({})local V=n(u)V(y,"\102\111\111","\098\097\114");(expect(rawget(y,"\102\111\111"))).to.never.be.ok();(expect(y.foo)).to.equal("\098\097\114")end)it("\115\104\111\117\108\100 \097\108\108\111\119 \110\111\110-\100\114\097\102\116\115 \105\110 \116\104\101 \114\101\116\117\114\110\101\100 \100\114\097\102\116-\115\097\102\101 \102\117\110\099\116\105\111\110",function()local Q={}local u=n(table.insert);(expect(function()u(Q,"\102\111\111")end)).to.never.throw();(expect(Q[1])).to.equal("\102\111\111")end)end
return function()
	local Draft = require(script.Parent.Draft)
	local makeDraftSafe = require(script.Parent.makeDraftSafe)

	it("should return a draft-safe version of the given function", function()
		local function unsafe(t, k, v)
			rawset(t, k, v)
		end

		local draft = Draft.new({})

		local safe = makeDraftSafe(unsafe)
		safe(draft, "foo", "bar")

		expect(rawget(draft, "foo")).to.never.be.ok()
		expect(draft.foo).to.equal("bar")
	end)

	it("should allow non-drafts in the returned draft-safe function", function()
		local nonDraft = {}

		local safe = makeDraftSafe(table.insert)

		expect(function()
			safe(nonDraft, "foo")
		end).to.never.throw()
		
		expect(nonDraft[1]).to.equal("foo")
	end)
end
