local f=import("\046\047\109\097\116\104")describe("\108\105\098\115\046\109\097\116\104",function()describe("\099\108\097\109\112",function()it("\115\104\111\117\108\100 \098\101 \097 \102\117\110\099\116\105\111\110",function()assert.is_function(f.clamp)end)it("\115\104\111\117\108\100 \099\108\097\109\112 \105\102 \062 \109\097\120",function()assert.are.equals(1,f.clamp(2,0,1))end)it("\115\104\111\117\108\100 \099\108\097\109\112 \105\102 \060 \109\105\110",function()assert.are.equals(0,f.clamp(-1,0,1))end)it("\115\104\111\117\108\100 \110\111\116 \099\108\097\109\112 \105\102 \118\097\108\117\101 \105\115 \098\101\116\119\101\101\110 \109\105\110 \097\110\100 \109\097\120",function()assert.are.equals(.5,f.clamp(.5,0,1))end)end)end)
local math = import("./math")

describe("libs.math", function()
	describe("clamp", function()
		it("should be a function", function()
			assert.is_function(math.clamp)
		end)

		it("should clamp if > max", function()
			assert.are.equals(1, math.clamp(2, 0, 1))
		end)

		it("should clamp if < min", function()
			assert.are.equals(0, math.clamp(-1, 0, 1))
		end)

		it("should not clamp if value is between min and max", function()
			assert.are.equals(0.5, math.clamp(0.5, 0, 1))
		end)
	end)
end)