Added more tests

This commit is contained in:
Devine Lu Linvega 2019-07-14 08:28:24 +09:00
parent c571d32ef2
commit c99ae1dad7
2 changed files with 14 additions and 0 deletions

View File

@ -70,6 +70,10 @@ function Library (ronin) {
return arr[0]
}
this.last = (arr) => {
return arr[arr.length - 1]
}
this.rest = ([_, ...arr]) => {
return arr
}

View File

@ -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")
)