return function()local Q=require(script.Parent.GroupMotor)local R=require(script.Parent.Instant)local w=require(script.Parent.Spring)it("\115\104\111\117\108\100 \099\111\109\112\108\101\116\101 \119\104\101\110 \097\108\108 \099\104\105\108\100 \109\111\116\111\114\115 \097\114\101 \099\111\109\112\108\101\116\101",function()local S=Q.new({A=1;B=2},false);(expect(S._complete)).to.equal(true)S:setGoal({A=R.new(3);B=w.new(4,{frequency=7.5,dampingRatio=1})});(expect(S._complete)).to.equal(false)S:step(.016666666666667);(expect(S._complete)).to.equal(false)for Q=1,30.0,1 do S:step(.016666666666667)end;(expect(S._complete)).to.equal(true)end)it("\115\104\111\117\108\100 \115\116\097\114\116 \119\104\101\110 \116\104\101 \103\111\097\108 \105\115 \115\101\116",function()local w=Q.new({A=0},false)local S=false w:onStart(function()S=not S end)w:setGoal({A=R.new(1)});(expect(S)).to.equal(true)w:setGoal({A=R.new(1)});(expect(S)).to.equal(false)end)it("\115\104\111\117\108\100 \112\114\111\112\101\114\108\121 \114\101\116\117\114\110 \097\108\108 \118\097\108\117\101\115",function()local R=Q.new({A=1,B=2},false)local w=R:getValue();(expect(w.A)).to.equal(1);(expect(w.B)).to.equal(2)end)it("\115\104\111\117\108\100 \101\114\114\111\114 \119\104\101\110 \097 \103\111\097\108 \105\115 \103\105\118\101\110 \116\111 \071\114\111\117\112\077\111\116\111\114\046\110\101\119",function()local w=pcall(function()Q.new(R.new(0))end);(expect(w)).to.equal(false)end)it("\115\104\111\117\108\100 \101\114\114\111\114 \119\104\101\110 \097 \115\105\110\103\108\101 \103\111\097\108 \105\115 \112\114\111\118\105\100\101\100 \116\111 \071\114\111\117\112\077\111\116\111\114\058\115\116\101\112",function()local w=pcall(function()(Q.new({a=1})):setGoal(R.new(0))end);(expect(w)).to.equal(false)end)end
return function()
	local GroupMotor = require(script.Parent.GroupMotor)

	local Instant = require(script.Parent.Instant)
	local Spring = require(script.Parent.Spring)

	it("should complete when all child motors are complete", function()
		local motor = GroupMotor.new({
			A = 1,
			B = 2,
		}, false)

		expect(motor._complete).to.equal(true)

		motor:setGoal({
			A = Instant.new(3),
			B = Spring.new(4, { frequency = 7.5, dampingRatio = 1 })
		})

		expect(motor._complete).to.equal(false)

		motor:step(1/60)

		expect(motor._complete).to.equal(false)

		for _ = 1, 0.5 * 60 do
			motor:step(1/60)
		end

		expect(motor._complete).to.equal(true)
	end)

	it("should start when the goal is set", function()
		local motor = GroupMotor.new({
			A = 0,
		}, false)

		local bool = false
		motor:onStart(function()
			bool = not bool
		end)

		motor:setGoal({
			A = Instant.new(1)
		})

		expect(bool).to.equal(true)

		motor:setGoal({
			A = Instant.new(1)
		})

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

	it("should properly return all values", function()
		local motor = GroupMotor.new({
			A = 1,
			B = 2,
		}, false)

		local value = motor:getValue()

		expect(value.A).to.equal(1)
		expect(value.B).to.equal(2)
	end)

	it("should error when a goal is given to GroupMotor.new", function()
		local success = pcall(function()
			GroupMotor.new(Instant.new(0))
		end)

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

	it("should error when a single goal is provided to GroupMotor:step", function()
		local success = pcall(function()
			GroupMotor.new({ a = 1 }):setGoal(Instant.new(0))
		end)

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