summaryrefslogtreecommitdiff
path: root/lib/head.test.fnl
diff options
context:
space:
mode:
authordozens2024-05-28 15:04:00 -0600
committerdozens2024-05-28 15:04:00 -0600
commitf265d24c0cacb92c7f7db19f364a155d87938184 (patch)
treea6e3ce61dee9020b79c8f2d8e3c91b51bc29e959 /lib/head.test.fnl
inits
Diffstat (limited to 'lib/head.test.fnl')
-rw-r--r--lib/head.test.fnl11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/head.test.fnl b/lib/head.test.fnl
new file mode 100644
index 0000000..7514121
--- /dev/null
+++ b/lib/head.test.fnl
@@ -0,0 +1,11 @@
+(let [{: head } (require :lib.head)]
+ (let [given "a lift of elements"
+ it "returns the first element of a list"
+ expected :apple
+ actual (head [:apple :orange :pear])]
+ (assert (= actual expected) (.. "Given " given " it " it)))
+ (let [given "an empty list"
+ it "returns an empty list"
+ expected 0
+ actual (length (head []))]
+ (assert (= actual expected) (.. "Given " given " it " it))))