84
84
compare(clamped, maxValue, "clamped value not within range")
87
function test_clamp_positive_lower_switched() {
92
ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
94
var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
95
compare(clamped, maxValue, "clamped value not within range")
98
function test_clamp_positive_greater_switched() {
103
ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
105
var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
106
compare(clamped, minValue, "clamped value not within range")
109
function test_clamp_positive_within_switched() {
114
ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
116
var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
117
compare(clamped, clampValue, "clamped value changed even though it shouldn't have")
120
function test_clamp_positive_on_border_switched() {
125
ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
127
var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
128
compare(clamped, clampValue, "clamped value changed even though it shouldn't have")
131
function test_clamp_negative_lower_switched() {
136
ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
138
var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
139
compare(clamped, maxValue, "clamped value not within range")
142
function test_clamp_negative_greater_switched() {
147
ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
149
var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
150
compare(clamped, minValue, "clamped value not within range")
153
function test_clamp_postive_and_negative_greater_switched() {
158
ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
160
var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
161
compare(clamped, minValue, "clamped value not within range")
87
164
function test_lerp() {
88
165
var lerped = MathUtils.lerp(0.25, 90, 0)
89
166
compare(lerped, 67.5)