return function()local w=require(script.Parent.Parent.sortCounterClockwise)local y=require(script.Parent.Parent.getConvexHull)local Y=require(script.Parent.Parent.getPolygonArea)local K=require(script.Parent.isRectangle)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \105\102 \103\105\118\101\110 \108\101\115\115 \116\104\097\110 \052 \112\111\105\110\116\115",function()local N={Vector2.new(0,0),Vector2.new(0,5);Vector2.new(5,0)}local E=w(N)local x=y(E)local M=Y(x);(expect(K(x,M))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \105\102 \103\105\118\101\110 \097 \115\113\117\097\114\101",function()local N={Vector2.new(0,0),Vector2.new(0,5);Vector2.new(5,5);Vector2.new(5,0)}local E=w(N)local x=y(E)local M=Y(x);(expect(K(x,M))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \105\102 \103\105\118\101\110 \097 \114\101\099\116\097\110\103\108\101",function()local N={Vector2.new(0,0);Vector2.new(5,0),Vector2.new(5,10);Vector2.new(0,10)}local E=w(N)local x=y(E)local M=Y(x);(expect(K(x,M))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \105\102 \103\105\118\101\110 \097 \118\101\114\121 \115\107\105\110\110\121 \114\101\099\116\097\110\103\108\101",function()local N={Vector2.new(0,0),Vector2.new(2,0),Vector2.new(2,20),Vector2.new(0,20)}local E=w(N)local x=y(E)local M=Y(x);(expect(K(x,M))).to.equal(true)end)end
return function()
	local sortCounterClockwise = require(script.Parent.Parent.sortCounterClockwise)
	local getConvexHull = require(script.Parent.Parent.getConvexHull)
	local getPolygonArea = require(script.Parent.Parent.getPolygonArea)
	local isRectangle = require(script.Parent.isRectangle)

	it("should return false if given less than 4 points", function()
		-- https://www.desmos.com/calculator/gay2ou3an9
		local points = {
			Vector2.new(0, 0),
			Vector2.new(0, 5),
			Vector2.new(5, 0),
		}

		local sorted = sortCounterClockwise(points)
		local hull = getConvexHull(sorted)
		local hullArea = getPolygonArea(hull)

		expect(isRectangle(hull, hullArea)).to.equal(false)
	end)

	it("should return true if given a square", function()
		-- https://www.desmos.com/calculator/u0qqdblmrg
		local points = {
			Vector2.new(0, 0),
			Vector2.new(0, 5),
			Vector2.new(5, 5),
			Vector2.new(5, 0),
		}

		local sorted = sortCounterClockwise(points)
		local hull = getConvexHull(sorted)
		local hullArea = getPolygonArea(hull)

		expect(isRectangle(hull, hullArea)).to.equal(true)
	end)

	it("should return true if given a rectangle", function()
		local points = {
			Vector2.new(0, 0),
			Vector2.new(5, 0),
			Vector2.new(5, 10),
			Vector2.new(0, 10),
		}

		local sorted = sortCounterClockwise(points)
		local hull = getConvexHull(sorted)
		local hullArea = getPolygonArea(hull)

		expect(isRectangle(hull, hullArea)).to.equal(true)
	end)

	it("should return true if given a very skinny rectangle", function()
		local points = {
			Vector2.new(0, 0),
			Vector2.new(2, 0),
			Vector2.new(2, 20),
			Vector2.new(0, 20),
		}

		local sorted = sortCounterClockwise(points)
		local hull = getConvexHull(sorted)
		local hullArea = getPolygonArea(hull)

		expect(isRectangle(hull, hullArea)).to.equal(true)
	end)
end
