aboutsummaryrefslogtreecommitdiff
path: root/tests/functions.lisp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-02-21 13:59:13 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-02-21 14:11:08 +0000
commite9dcba06bb5818d7b7b3f9c63e09d30070109fca (patch)
tree2e3c521df5082a1d7861d4b5688eb6fcaea302b3 /tests/functions.lisp
parent4b4421c101a269051e53d76313d5035d27b4b074 (diff)
downloadcantedraw-e9dcba06bb5818d7b7b3f9c63e09d30070109fca.tar.gz
cantedraw-e9dcba06bb5818d7b7b3f9c63e09d30070109fca.tar.bz2
cantedraw-e9dcba06bb5818d7b7b3f9c63e09d30070109fca.zip
Add unit tests for lib.functions.take
Diffstat (limited to 'tests/functions.lisp')
-rw-r--r--tests/functions.lisp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/functions.lisp b/tests/functions.lisp
index 0025827..8582213 100644
--- a/tests/functions.lisp
+++ b/tests/functions.lisp
@@ -39,3 +39,12 @@
(true (null (range 1 1)))
(is equal '(1 2 3 4) (range 1 5))
(is equal '(-3 -2 -1 0) (range -3 1)))
+
+(define-test (function-test take)
+ :compile-at :execute
+ (fail (take nil nil))
+ (fail (take 100 nil))
+ (fail (take nil 100))
+ (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))))