clamp macro
This commit is contained in:
@@ -313,6 +313,10 @@ class BasicTestCase extends Test {
|
||||
function testDotAccessOnAlias() {
|
||||
_testDotAccessOnAlias();
|
||||
}
|
||||
|
||||
function testClamp() {
|
||||
_testClamp();
|
||||
}
|
||||
}
|
||||
|
||||
class BasicObject {
|
||||
|
@@ -546,4 +546,12 @@
|
||||
(var float 0.5) // This should still read as a float, not a dot access on a variable called 0
|
||||
(defAlias &ident owf objWithField)
|
||||
(function _testDotAccessOnAlias []
|
||||
(Assert.equals 5 owf.field))
|
||||
(Assert.equals 5 owf.field))
|
||||
|
||||
(function _testClamp []
|
||||
(let [&mut bigValue 12
|
||||
&mut smallValue 3]
|
||||
(Assert.equals 10 (clamp bigValue 5 10))
|
||||
(Assert.equals 10 bigValue)
|
||||
(Assert.equals 5 (clamp smallValue 5 10))
|
||||
(Assert.equals 5 smallValue)))
|
Reference in New Issue
Block a user