aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-02-21 14:00:08 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-02-21 14:11:08 +0000
commitdc6b2f701bd1cc36a55039f7fc36ac48a3d439df (patch)
tree380afdaa3449a716c8e16a4f5ef0f7d8002de6d1 /tests
parente9dcba06bb5818d7b7b3f9c63e09d30070109fca (diff)
downloadcantedraw-dc6b2f701bd1cc36a55039f7fc36ac48a3d439df.tar.gz
cantedraw-dc6b2f701bd1cc36a55039f7fc36ac48a3d439df.tar.bz2
cantedraw-dc6b2f701bd1cc36a55039f7fc36ac48a3d439df.zip
Add unit tests for lib.functions.split
Diffstat (limited to 'tests')
-rw-r--r--tests/functions.lisp15
1 files changed, 15 insertions, 0 deletions
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")))