summaryrefslogtreecommitdiff
path: root/test/res/test.lisp
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-04-30 00:12:27 +0200
committerLinnea Gräf <nea@nea.moe>2024-04-30 00:12:27 +0200
commitb51321b27fdf513a3de09d084bbd4e69a26fb76e (patch)
tree873c433cc96e382321736fe0bcb4e2948789ced6 /test/res/test.lisp
parent37d5b9ce0acf6eb25162c097990983f388ec3a19 (diff)
downloadnealisp-b51321b27fdf513a3de09d084bbd4e69a26fb76e.tar.gz
nealisp-b51321b27fdf513a3de09d084bbd4e69a26fb76e.tar.bz2
nealisp-b51321b27fdf513a3de09d084bbd4e69a26fb76e.zip
Add lists
Diffstat (limited to 'test/res/test.lisp')
-rw-r--r--test/res/test.lisp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/res/test.lisp b/test/res/test.lisp
index 39c6d82..713ee2a 100644
--- a/test/res/test.lisp
+++ b/test/res/test.lisp
@@ -36,3 +36,29 @@
((test.assert-eqd 0xFFFFFFFF 4294967295 0.0001))
))
+(test.test "List joining" (seq
+ ((test.assert-eq
+ (list.new 1 2 3 4)
+ (list.join [list.new 1 2] [list.new 3 4])
+ ))
+ ))
+
+(test.test "List slicing" (seq
+ ((test.assert-eq
+ (list.slice [list.new 1 2 3 4] 2 4)
+ (list.new 3 4)
+ ))
+ ))
+
+(test.test "List length"
+ ((test.assert-eq [list.length (list.new 1 2 3 4)] 4))
+ )
+
+(test.test "List mapping"
+ ((test.assert-eq
+ [list.map (list.new 1 2 3 4) (lambda (x) (+ 1 x))]
+ [list.new 2 3 4 5]))
+ )
+
+
+