local T=require(script.Parent.Util.BasicallyIdentical)return function()local Z=require(script.Parent.Lighten)it("\116\104\114\111\119\115 \105\102 \097\114\103\117\109\101\110\116 \105\115 \110\111\116 \097 \067\111\108\111\114\051",function()(expect(pcall(Z,true))).to.equal(false)end)it("\100\111\101\115\110\'\116 \109\111\100\105\102\121 \119\104\105\116\101",function()local r=Z(Color3.new(1,1,1),.1);(expect(T(Color3.new(1,1,1),r))).to.equal(true)end)it("\100\111\101\115\110\'\116 \111\118\101\114\115\104\111\111\116 \105\102 \097\110 \097\098\111\118\101-\114\097\110\103\101 \099\111\101\102\102\105\099\105\101\110\116 \105\115 \115\117\112\112\108\105\101\100",function()local r=Z(Color3.new(0,.5,1),1.5);(expect(T(Color3.new(1,1,1),r))).to.equal(true)end)it("\100\111\101\115\110\'\116 \111\118\101\114\115\104\111\111\116 \105\102 \097 \098\101\108\111\119-\114\097\110\103\101 \099\111\101\102\102\105\099\105\101\110\116 \105\115 \115\117\112\112\108\105\101\100",function()local r=Z(Color3.new(0,.5,1),-1.5);(expect(T(Color3.new(0,0,1),r))).to.equal(true)end)it("\108\105\103\104\116\101\110\115 \098\108\097\099\107 \116\111 \119\104\105\116\101 \119\104\101\110 \099\111\101\102\102\105\099\105\101\110\116 \105\115 \049",function()local r=Z(Color3.new(),1);(expect(T(Color3.new(1,1,1),r))).to.equal(true)end)it("\108\105\103\104\116\101\110\115 \098\108\097\099\107 \098\121 \049\048\037 \119\104\101\110 \099\111\101\102\102\105\099\105\101\110\116 \105\115 \048\046\049",function()local r=Z(Color3.new(0,0,0),.1);(expect(T(Color3.new(.1,.1,.1),r))).to.equal(true)end)it("\108\105\103\104\116\101\110\115 \114\101\100 \098\121 \053\048\037 \119\104\101\110 \099\111\101\102\102\105\099\105\101\110\116 \105\115 \048\046\053",function()local r=Z(Color3.new(1,0,0),.5);(expect(T(Color3.new(1,.5,.5),r))).to.equal(true)end)it("\108\105\103\104\116\101\110\115 \103\114\101\121 \098\121 \053\048\037 \119\104\101\110 \099\111\101\102\102\105\099\105\101\110\116 \105\115 \048\046\053",function()local r=Z(Color3.new(.5,.5,.5),.5);(expect(T(Color3.new(.75,.75,.75),r))).to.equal(true)end)it("\100\111\101\115\110\'\116 \109\111\100\105\102\121 \099\111\108\111\114\115 \119\104\101\110 \099\111\101\102\102\105\099\105\101\110\116 \105\115 \048",function()local r=Z(Color3.new(.5,.5,.5),0);(expect(T(Color3.new(.5,.5,.5),r))).to.equal(true)end)end
local BasicallyIdentical = require(script.Parent.Util.BasicallyIdentical)

return function()
	local Lighten = require(script.Parent.Lighten)

	it("throws if argument is not a Color3", function()
		expect(pcall(Lighten, true)).to.equal(false)
	end)

	it("doesn't modify white", function()
		local color = Lighten(Color3.new(1, 1, 1), 0.1)
		expect(BasicallyIdentical(Color3.new(1, 1, 1), color)).to.equal(true)
	end)

	it("doesn't overshoot if an above-range coefficient is supplied", function()
		local color = Lighten(Color3.new(0, 0.5, 1), 1.5)
		expect(BasicallyIdentical(Color3.new(1, 1, 1), color)).to.equal(true)
	end)

	it("doesn't overshoot if a below-range coefficient is supplied", function()
		local color = Lighten(Color3.new(0, 0.5, 1), -1.5)
		expect(BasicallyIdentical(Color3.new(0, 0, 1), color)).to.equal(true)
	end)

	it("lightens black to white when coefficient is 1", function()
		local color = Lighten(Color3.new(), 1)
		expect(BasicallyIdentical(Color3.new(1, 1, 1), color)).to.equal(true)
	end)

	it("lightens black by 10% when coefficient is 0.1", function()
		local color = Lighten(Color3.new(0, 0, 0), 0.1)
		expect(BasicallyIdentical(Color3.new(0.1, 0.1, 0.1), color)).to.equal(true)
	end)

	it("lightens red by 50% when coefficient is 0.5", function()
		local color = Lighten(Color3.new(1, 0, 0), 0.5)
		expect(BasicallyIdentical(Color3.new(1, 0.5, 0.5), color)).to.equal(true)
	end)

	it("lightens grey by 50% when coefficient is 0.5", function()
		local color = Lighten(Color3.new(0.5, 0.5, 0.5), 0.5)
		expect(BasicallyIdentical(Color3.new(0.75, 0.75, 0.75), color)).to.equal(true)
	end)

	it("doesn't modify colors when coefficient is 0", function()
		local color = Lighten(Color3.new(0.5, 0.5, 0.5), 0)
		expect(BasicallyIdentical(Color3.new(0.5, 0.5, 0.5), color)).to.equal(true)
	end)
end
