Added more tests
This commit is contained in:
parent
c571d32ef2
commit
c99ae1dad7
@ -70,6 +70,10 @@ function Library (ronin) {
|
||||
return arr[0]
|
||||
}
|
||||
|
||||
this.last = (arr) => {
|
||||
return arr[arr.length - 1]
|
||||
}
|
||||
|
||||
this.rest = ([_, ...arr]) => {
|
||||
return arr
|
||||
}
|
||||
|
@ -13,4 +13,14 @@
|
||||
(test "mod" (mod 6 4) 2)
|
||||
(test "clamp" (clamp 12 4 8) 8)
|
||||
(test "step" (step 12 10) 10)
|
||||
|
||||
; Logic
|
||||
|
||||
(test "lt" (lt 3 4) true)
|
||||
(test "gt" (gt 3 4) false)
|
||||
|
||||
; Arrays
|
||||
|
||||
(test "first" (first ("a" "b" "c")) "a")
|
||||
(test "last" (last ("a" "b" "c")) "c")
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user