return function()local B=require(script.Parent)it("\115\104\111\117\108\100 \098\101 \097 \102\117\110\099\116\105\111\110",function()(expect(B)).to.be.a("\102\117\110\099\116\105\111\110")end)it("\115\104\111\117\108\100 \099\097\108\108 \102\117\110\099\116\105\111\110\115 \110\111\114\109\097\108\108\121",function()local w=0 local function x(B,x)(expect(B)).to.equal(5);(expect(x)).to.equal(6)w=w+1 return 11,"\104\101\108\108\111"end local H,X=B(" ",x,5,6);(expect(H)).to.equal(11);(expect(X)).to.equal("\104\101\108\108\111")end)it("\115\104\111\117\108\100 \116\104\114\111\119 \111\110 \121\105\101\108\100",function()local w=0 local x=0 local function H()w=w+1 task.wait()x=x+1 end local X,u=pcall(B," ",H);(expect(w)).to.equal(1);(expect(x)).to.equal(0);(expect(X)).to.equal(false)end)it("\115\104\111\117\108\100 \112\114\111\112\097\103\097\116\101 \101\114\114\111\114 \109\101\115\115\097\103\101\115",function()local w=0 local function x()w=w+1 error("\102\111\111")end local H,X=pcall(B," ",x);(expect(H)).to.equal(false);(expect(X:find("\102\111\111"))).to.be.ok()end)it("\115\104\111\117\108\100 \116\104\114\111\119 \097\110 \101\114\114\111\114 \119\104\101\110 \105\110\118\097\108\105\100 \097\114\103\117\109\101\110\116\115 \112\114\111\118\105\100\101\100",function()(expect(function()B(" "," ")end)).to.throw();(expect(function()B()end)).to.throw()end)end
return function()
	local NoYield = require(script.Parent)

	it("should be a function", function()
		expect(NoYield).to.be.a("function")
	end)

	it("should call functions normally", function()
		local callCount = 0

		local function test(a, b)
			expect(a).to.equal(5)
			expect(b).to.equal(6)

			callCount = callCount + 1

			return 11, "hello"
		end

		local a, b = NoYield(" ", test, 5, 6)

		expect(a).to.equal(11)
		expect(b).to.equal("hello")
	end)

	it("should throw on yield", function()
		local preCount = 0
		local postCount = 0

		local function testMethod()
			preCount = preCount + 1
			task.wait()
			postCount = postCount + 1
		end

		local ok, err = pcall(NoYield, " ", testMethod)

		expect(preCount).to.equal(1)
		expect(postCount).to.equal(0)

		expect(ok).to.equal(false)
	end)

	it("should propagate error messages", function()
		local count = 0

		local function test()
			count = count + 1
			error("foo")
		end

		local ok, err = pcall(NoYield, " ", test)

		expect(ok).to.equal(false)
		expect(err:find("foo")).to.be.ok()
	end)

	it("should throw an error when invalid arguments provided", function()
		expect(function()
			NoYield(" ", " ")
		end).to.throw()

		expect(function()
			NoYield()
		end).to.throw()
	end)
end
