9mm/lib/head.test.fnl

13 lines
599 B
Plaintext
Raw Normal View History

2024-05-30 01:26:41 +00:00
(let [{: head} (require :lib.head)
{: describe :end test-end} (require :lib.test)]
(describe "head()" (fn [t]
(t {:given "a list of elements"
:should "returns the first element of a list"
:expected :apple
:actual (head [:apple :orange :pear])})
(t {:given "an empty list"
:should "returns an empty list"
:expected 0
:actual (length (head []))})
(test-end))))