local w=require(script.Parent.Parent.Util.BasicallyIdentical)return function()local u=require(script.Parent)local T=Color3.fromHex("\035\048\048\097\050\102\102")local S={H=202;S=100,L=50}describe("\116\111\072\083\076",function()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(function()u.toHSL(nil)end)).to.throw()end)it("\115\104\111\117\108\100 \099\111\110\118\101\114\116 \116\111 \072\083\076",function()local w=u.toHSL(T);(expect(w.H)).to.equal(S.H);(expect(w.S)).to.equal(S.S);(expect(w.L)).to.equal(S.L)end)end)describe("\102\114\111\109\072\083\076",function()it("\116\104\114\111\119\115 \105\102 \097\114\103\117\109\101\110\116 \105\115 \110\111\116 \097 \072\083\076 \116\097\098\108\101",function()(expect(function()u.fromHSL(nil)end)).to.throw();(expect(function()u.fromHSL({})end)).to.throw()end)it("\115\104\111\117\108\100 \099\111\110\118\101\114\116 \116\111 \067\111\108\111\114\051",function()local Z=u.fromHSL(S);(expect(w(Z,T))).to.equal(true)end)end)end
local BasicallyIdentical = require(script.Parent.Parent.Util.BasicallyIdentical)

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

	local TEST_COLOR3 = Color3.fromHex("#00a2ff")
	local TEST_HSL = { H = 202, S = 100, L = 50 }

	describe("toHSL", function()
		it("throws if argument is not a Color3", function()
			expect(function()
				HSL.toHSL(nil)
			end).to.throw()
		end)

		it("should convert to HSL", function()
			local hsl = HSL.toHSL(TEST_COLOR3)

			expect(hsl.H).to.equal(TEST_HSL.H)
			expect(hsl.S).to.equal(TEST_HSL.S)
			expect(hsl.L).to.equal(TEST_HSL.L)
		end)
	end)

	describe("fromHSL", function()
		it("throws if argument is not a HSL table", function()
			expect(function()
				HSL.fromHSL(nil)
			end).to.throw()

			expect(function()
				HSL.fromHSL({})
			end).to.throw()
		end)

		it("should convert to Color3", function()
			local color3 = HSL.fromHSL(TEST_HSL)

			expect(BasicallyIdentical(color3, TEST_COLOR3)).to.equal(true)
		end)
	end)
end
