local B=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local R=require(B.Packages.Dex.Util.PolymorphicLerp)return function()it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \110\117\109\098\101\114\115",function()local B=R("\110\117\109\098\101\114")local j=B(10,20,.5);(expect(j)).to.equal(15)end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \086\101\099\116\111\114\050",function()local B=R("\086\101\099\116\111\114\050")local j=B(Vector2.new(0,0),Vector2.new(10,20),.5);(expect(typeof(j))).to.equal("\086\101\099\116\111\114\050");(expect(j.X)).to.equal(5);(expect(j.Y)).to.equal(10)end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \086\101\099\116\111\114\050\105\110\116\049\054",function()local B=R("\086\101\099\116\111\114\050\105\110\116\049\054")local j=B(Vector2int16.new(0,0),Vector2int16.new(10,20),.5);(expect(typeof(j))).to.equal("\086\101\099\116\111\114\050\105\110\116\049\054");(expect(j.X)).to.equal(5);(expect(j.Y)).to.equal(10)end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \086\101\099\116\111\114\051",function()local B=R("\086\101\099\116\111\114\051")local j=B(Vector3.new(0,0,0),Vector3.new(10,20,30),.5);(expect(typeof(j))).to.equal("\086\101\099\116\111\114\051");(expect(j.X)).to.equal(5);(expect(j.Y)).to.equal(10);(expect(j.Z)).to.equal(15)end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \086\101\099\116\111\114\051\105\110\116\049\054",function()local B=R("\086\101\099\116\111\114\051\105\110\116\049\054")local j=B(Vector3int16.new(0,0,0),Vector3int16.new(10,20,30),.5);(expect(typeof(j))).to.equal("\086\101\099\116\111\114\051\105\110\116\049\054");(expect(j.X)).to.equal(5);(expect(j.Y)).to.equal(10);(expect(j.Z)).to.equal(15)end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \067\070\114\097\109\101",function()local B=R("\067\070\114\097\109\101")local j=B(CFrame.new(0,0,0),CFrame.new(10,20,30),.5);(expect(typeof(j))).to.equal("\067\070\114\097\109\101");(expect(j)).to.equal(CFrame.new(5,10,15))end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \067\111\108\111\114\051",function()local B=R("\067\111\108\111\114\051")local j=B(Color3.new(0,0,0),Color3.new(1,1,1),.5);(expect(typeof(j))).to.equal("\067\111\108\111\114\051");(expect(j)).to.equal(Color3.new(.5,.5,.5))end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \085\068\105\109",function()local B=R("\085\068\105\109")local j=B(UDim.new(0,0),UDim.new(10,20),.5);(expect(typeof(j))).to.equal("\085\068\105\109");(expect(j)).to.equal(UDim.new(5,10))end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \085\068\105\109\050",function()local B=R("\085\068\105\109\050")local j=B(UDim2.new(0,0,0,0),UDim2.new(10,20,30,40),.5);(expect(typeof(j))).to.equal("\085\068\105\109\050");(expect(j)).to.equal(UDim2.new(5,10,15,20))end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \098\111\111\108\101\097\110",function()local B=R("\098\111\111\108\101\097\110")local j=B(true,false,.5);(expect(j)).to.equal(true)local n=B(false,true,.5);(expect(n)).to.equal(true)local D=B(true,true,.5);(expect(D)).to.equal(true)end)it("\112\101\114\102\111\114\109\115 \112\111\108\121\109\111\114\112\104\105\099 \108\101\114\112 \102\111\114 \082\101\099\116",function()local B=R("\082\101\099\116")local j=B(Rect.new(0,0,0,0),Rect.new(10,20,30,40),.5);(expect(typeof(j))).to.equal("\082\101\099\116");(expect(j)).to.equal(Rect.new(5,10,15,20))end)end
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PolymorphicLerp = require(ReplicatedStorage.Packages.Dex.Util.PolymorphicLerp)

return function()
    it("performs polymorphic lerp for numbers", function()
        local lerp = PolymorphicLerp("number")
        local result = lerp(10, 20, 0.5)
        expect(result).to.equal(15)
    end)

    it("performs polymorphic lerp for Vector2", function()
        local lerp = PolymorphicLerp("Vector2")
        local result = lerp(Vector2.new(0, 0), Vector2.new(10, 20), 0.5)
        expect(typeof(result)).to.equal("Vector2")
        expect(result.X).to.equal(5)
        expect(result.Y).to.equal(10)
    end)

    it("performs polymorphic lerp for Vector2int16", function()
        local lerp = PolymorphicLerp("Vector2int16")
        local result = lerp(Vector2int16.new(0, 0),
            Vector2int16.new(10, 20), 0.5)
        expect(typeof(result)).to.equal("Vector2int16")
        expect(result.X).to.equal(5)
        expect(result.Y).to.equal(10)
    end)

    it("performs polymorphic lerp for Vector3", function()
        local lerp = PolymorphicLerp("Vector3")
        local result = lerp(Vector3.new(0, 0, 0), Vector3.new(10, 20, 30), 0.5)
        expect(typeof(result)).to.equal("Vector3")
        expect(result.X).to.equal(5)
        expect(result.Y).to.equal(10)
        expect(result.Z).to.equal(15)
    end)

    it("performs polymorphic lerp for Vector3int16", function()
        local lerp = PolymorphicLerp("Vector3int16")
        local result = lerp(Vector3int16.new(0, 0, 0),
            Vector3int16.new(10, 20, 30), 0.5)
        expect(typeof(result)).to.equal("Vector3int16")
        expect(result.X).to.equal(5)
        expect(result.Y).to.equal(10)
        expect(result.Z).to.equal(15)
    end)

        it("performs polymorphic lerp for CFrame", function()
        local lerp = PolymorphicLerp("CFrame")
        local result = lerp(CFrame.new(0, 0, 0), CFrame.new(10, 20, 30), 0.5)
        expect(typeof(result)).to.equal("CFrame")
        expect(result).to.equal(CFrame.new(5, 10, 15))
    end)

    it("performs polymorphic lerp for Color3", function()
        local lerp = PolymorphicLerp("Color3")
        local result = lerp(Color3.new(0, 0, 0), Color3.new(1, 1, 1), 0.5)
        expect(typeof(result)).to.equal("Color3")
        expect(result).to.equal(Color3.new(0.5, 0.5, 0.5))
    end)

    it("performs polymorphic lerp for UDim", function()
        local lerp = PolymorphicLerp("UDim")
        local result = lerp(UDim.new(0, 0), UDim.new(10, 20), 0.5)
        expect(typeof(result)).to.equal("UDim")
        expect(result).to.equal(UDim.new(5, 10))
    end)

    it("performs polymorphic lerp for UDim2", function()
        local lerp = PolymorphicLerp("UDim2")
        local result = lerp(
            UDim2.new(0, 0, 0, 0),
            UDim2.new(10, 20, 30, 40),
            0.5
        )
        expect(typeof(result)).to.equal("UDim2")
        expect(result).to.equal(UDim2.new(5, 10, 15, 20))
    end)

    it("performs polymorphic lerp for boolean", function()
        local lerp = PolymorphicLerp("boolean")
        local result1 = lerp(true, false, 0.5)
        expect(result1).to.equal(true)

        local result2 = lerp(false, true, 0.5)
        expect(result2).to.equal(true)

        local result3 = lerp(true, true, 0.5)
        expect(result3).to.equal(true)
    end)

    it("performs polymorphic lerp for Rect", function()
        local lerp = PolymorphicLerp("Rect")
        local result = lerp(
            Rect.new(0, 0, 0, 0),
            Rect.new(10, 20, 30, 40),
            0.5
        )
        expect(typeof(result)).to.equal("Rect")
        expect(result).to.equal(Rect.new(5, 10, 15, 20))
    end)
end