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.isSquare)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 \115\104\097\112\101 \116\104\097\116 \114\111\117\103\104\108\121 \114\101\115\101\109\098\108\101\115 \097 \115\113\117\097\114\101",function()local N={Vector2.new(0,0);Vector2.new(3,0),Vector2.new(8,1);Vector2.new(0,3);Vector2.new(.5,8),Vector2.new(3,8),Vector2.new(8,7)}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 \102\097\108\115\101 \105\102 \103\105\118\101\110 \097 \115\113\117\097\114\101 \119\105\116\104 \097\110 \111\117\116\108\105\101\114",function()local N={Vector2.new(0,0);Vector2.new(0,5);Vector2.new(5,5),Vector2.new(5,0),Vector2.new(100,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 \102\097\108\115\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(false)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 isSquare = require(script.Parent.isSquare)

	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(isSquare(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(isSquare(hull, hullArea)).to.equal(true)
	end)

	it("should return true if given a shape that roughly resembles a square", function()
		-- https://www.desmos.com/calculator/um3zmbazlq
		local points = {
			Vector2.new(0, 0),
			Vector2.new(3, 0),
			Vector2.new(8, 1),
			Vector2.new(0, 3),
			Vector2.new(0.5, 8),
			Vector2.new(3, 8),
			Vector2.new(8, 7),
		}

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

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

	it("should return false if given a square with an outlier", function()
		local points = {
			Vector2.new(0, 0),
			Vector2.new(0, 5),
			Vector2.new(5, 5),
			Vector2.new(5, 0),
			Vector2.new(100, 0),
		}

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

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

	it("should return false 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(isSquare(hull, hullArea)).to.equal(false)
	end)
end
