diff options
author | dozens | 2024-05-29 19:26:41 -0600 |
---|---|---|
committer | dozens | 2024-06-02 21:44:17 -0600 |
commit | 7c07d6e6ececbf73e18a639e00b3690d4827e12a (patch) | |
tree | 7d948da1b634d100feb32215dd5d263c5b01ab8b /lib/head.test.fnl | |
parent | f265d24c0cacb92c7f7db19f364a155d87938184 (diff) |
tests
Diffstat (limited to 'lib/head.test.fnl')
-rw-r--r-- | lib/head.test.fnl | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/head.test.fnl b/lib/head.test.fnl index 7514121..1209599 100644 --- a/lib/head.test.fnl +++ b/lib/head.test.fnl @@ -1,11 +1,12 @@ -(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)))) +(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)))) |