From dc6b2f701bd1cc36a55039f7fc36ac48a3d439df Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 21 Feb 2025 14:00:08 +0000 Subject: Add unit tests for lib.functions.split --- tests/functions.lisp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/functions.lisp') diff --git a/tests/functions.lisp b/tests/functions.lisp index 8582213..bfb7277 100644 --- a/tests/functions.lisp +++ b/tests/functions.lisp @@ -48,3 +48,18 @@ (true (->> (list 1 2 3 4) (take 0) null)) (is equal "H" (take 1 "Hello")) (is equal '(1 2) (take 2 '(1 2 3 4 5)))) + +(define-test (function-test split) + :compile-at :execute + (fail (split nil nil)) + (fail (split 100 nil)) + (fail (split nil 100)) + (is-values (split 0 '(1 2 3 4)) + (eq nil) + (equal '(1 2 3 4))) + (is-values (split 1 '(1 2 3 4)) + (equal '(1)) + (equal '(2 3 4))) + (is-values (split 5 "Hello World") + (string= "Hello") + (string= " World"))) -- cgit v1.2.3-13-gbd6f