local Y=script.Parent.Parent.TestEZ local J=require(Y.Context)return{["\067\111\110\116\101\120\116\046\110\101\119 \114\101\116\117\114\110\115 \097 \110\101\119 \099\111\110\116\101\120\116"]=function()assert(J.new(),"\067\111\110\116\101\120\116\046\110\101\119\040\041 \114\101\116\117\114\110\101\100 \110\105\108")end,["\099\111\110\116\101\120\116\046\102\111\111 \114\101\116\117\114\110\115 \110\105\108 \105\102 \105\116 \119\097\115\110\'\116 \115\101\116"]=function()local Y=J.new()assert(Y.foo==nil,string.format("\071\111\116 \037\115\044 \101\120\112\101\099\116\101\100 \110\105\108",tostring(Y.foo)))end,["\099\111\110\116\101\120\116\046\102\111\111 \114\101\116\117\114\110\115 \116\104\101 \118\097\108\117\101 \102\114\111\109 \115\101\116\116\105\110\103 \099\111\110\116\101\120\116\046\102\111\111"]=function()local Y=J.new()Y.foo="\066\065\082"assert(Y.foo=="\066\065\082",string.format("\071\111\116 \037\115\044 \101\120\112\101\099\116\101\100 \066\065\082",tostring(Y.foo)))end,["\099\111\110\116\101\120\116\046\102\111\111 \099\097\110\'\116 \098\101 \115\101\116 \116\119\105\099\101"]=function()local Y=J.new()Y.foo="\102\111\111"local q,G=pcall(function()Y.foo="\098\097\114"end)assert(not q,"\069\120\112\101\099\116\101\100 \115\101\099\111\110\100 \099\111\110\116\101\120\116\046\102\111\111 \116\111 \101\114\114\111\114")end;["\067\111\110\116\101\120\116\046\110\101\119 \097\099\099\101\112\116\115 \097 \112\097\114\101\110\116"]=function()local Y=J.new()assert(J.new(Y),"\067\111\110\116\101\120\116\046\110\101\119\040\112\097\114\101\110\116\041 \114\101\116\117\114\110\101\100 \110\105\108")end,["\065 \099\104\105\108\100 \099\111\110\116\101\120\116 \099\097\110 \115\116\105\108\108 \114\101\097\100 \105\116\115 \112\097\114\101\110\116 \118\097\108\117\101\115"]=function()local Y=J.new()Y.foo="\066\065\082"local q=J.new(Y)assert(q.foo=="\066\065\082",string.format("\071\111\116 \037\115\044 \101\120\112\101\099\116\101\100 \066\065\082",tostring(q.foo)))end,["\065 \112\097\114\101\110\116 \099\111\110\116\101\120\116 \099\097\110\'\116 \114\101\097\100 \105\116\115 \099\104\105\108\100 \118\097\108\117\101\115"]=function()local Y=J.new()local q=J.new(Y)q.foo="\066\065\082"assert(Y.foo==nil,string.format("\071\111\116 \037\115\044 \101\120\112\101\099\116\101\100 \110\105\108",tostring(Y.foo)))end,["\065 \099\104\105\108\100 \099\097\110\'\116 \111\118\101\114\119\114\105\116\101 \112\097\114\101\110\116 \118\097\108\117\101\115"]=function()local Y=J.new()Y.foo="\102\111\111"local q=J.new(Y)local G,p=pcall(function()q.foo="\098\097\114"end)assert(not G,"\069\120\112\101\099\116\101\100 \115\101\116\116\105\110\103 \099\104\105\108\100\046\102\111\111 \116\111 \101\114\114\111\114")end,["\065 \099\104\105\108\100 \119\111\110\'\116 \115\101\101 \099\104\097\110\103\101\115 \116\111 \116\104\101 \112\097\114\101\110\116"]=function()local Y=J.new()local q=J.new(Y)Y.foo="\102\111\111"assert(q.foo==nil,string.format("\071\111\116 \037\115\044 \101\120\112\101\099\116\101\100 \110\105\108",tostring(Y.foo)))end}
local TestEZ = script.Parent.Parent.TestEZ
local Context = require(TestEZ.Context)

return {
	["Context.new returns a new context"] = function()
		assert(Context.new(), "Context.new() returned nil")
	end,
	["context.foo returns nil if it wasn't set"] = function()
		local context = Context.new()
		assert(context.foo == nil, string.format("Got %s, expected nil", tostring(context.foo)))
	end,
	["context.foo returns the value from setting context.foo"] = function()
		local context = Context.new()
		context.foo = "BAR"
		assert(context.foo == "BAR", string.format("Got %s, expected BAR", tostring(context.foo)))
	end,
	["context.foo can't be set twice"] = function()
		local context = Context.new()
		context.foo = "foo"
		local success, _ = pcall(function()
			context.foo = "bar"
		end)
		assert(not success, "Expected second context.foo to error")
	end,
	["Context.new accepts a parent"] = function()
		local parent = Context.new()
		assert(Context.new(parent), "Context.new(parent) returned nil")
	end,
	["A child context can still read its parent values"] = function()
		local parent = Context.new()
		parent.foo = "BAR"
		local child = Context.new(parent)
		assert(child.foo == "BAR", string.format("Got %s, expected BAR", tostring(child.foo)))
	end,
	["A parent context can't read its child values"] = function()
		local parent = Context.new()
		local child = Context.new(parent)
		child.foo = "BAR"
		assert(parent.foo == nil, string.format("Got %s, expected nil", tostring(parent.foo)))
	end,
	["A child can't overwrite parent values"] = function()
		local parent = Context.new()
		parent.foo = "foo"
		local child = Context.new(parent)
		local success, _ = pcall(function()
			child.foo = "bar"
		end)
		assert(not success, "Expected setting child.foo to error")
	end,
	["A child won't see changes to the parent"] = function()
		local parent = Context.new()
		local child = Context.new(parent)
		parent.foo = "foo"
		assert(child.foo == nil, string.format("Got %s, expected nil", tostring(parent.foo)))
	end,
}
