From f265d24c0cacb92c7f7db19f364a155d87938184 Mon Sep 17 00:00:00 2001 From: dozens Date: Tue, 28 May 2024 15:04:00 -0600 Subject: inits --- lib/head.test.fnl | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/head.test.fnl (limited to 'lib/head.test.fnl') 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)))) -- cgit 1.4.1-2-gfad0