return function()local z=require(script.Parent.GroupMotor)local a=require(script.Parent.Instant)local h=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 n=z.new({A=1;B=2},false);(expect(n._complete)).to.equal(true)n:setGoal({A=a.new(3);B=h.new(4,{frequency=7.5;dampingRatio=1})});(expect(n._complete)).to.equal(false)n:step(.016666666666667);(expect(n._complete)).to.equal(false)for z=1,30.0,1 do n:step(.016666666666667)end;(expect(n._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 h=z.new({A=0},false)local n=false h:onStart(function()n=not n end)h:setGoal({A=a.new(1)});(expect(n)).to.equal(true)h:setGoal({A=a.new(1)});(expect(n)).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 a=z.new({A=1;B=2},false)local h=a:getValue();(expect(h.A)).to.equal(1);(expect(h.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 h=pcall(function()z.new(a.new(0))end);(expect(h)).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 h=pcall(function()(z.new({a=1})):setGoal(a.new(0))end);(expect(h)).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
