From b51321b27fdf513a3de09d084bbd4e69a26fb76e Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Tue, 30 Apr 2024 00:12:27 +0200 Subject: Add lists --- test/res/test.lisp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/res/test.lisp') 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])) + ) + + + -- cgit