From 7c07d6e6ececbf73e18a639e00b3690d4827e12a Mon Sep 17 00:00:00 2001 From: dozens Date: Wed, 29 May 2024 19:26:41 -0600 Subject: tests --- lib/equal.test.fnl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/equal.test.fnl (limited to 'lib/equal.test.fnl') diff --git a/lib/equal.test.fnl b/lib/equal.test.fnl new file mode 100644 index 0000000..0ee8da7 --- /dev/null +++ b/lib/equal.test.fnl @@ -0,0 +1,28 @@ +(let [{: equal} (require :lib.equal) + {: describe :end test-end} (require :lib.test)] + (describe "equal()" (fn [t] + (t {:given "two equal tables" + :should "return true" + :expected true + :actual (equal [:orange :apple :pear] [:orange :apple :pear]) }) + (t {:given "two different tables" + :should "return false" + :expected false + :actual (equal [:apple :pear] [:orange :apple :pear]) }) + (t {:given "equal strings" + :should "be true" + :expected true + :actual (equal :apple :apple) }) + (t {:given "different strings" + :should "be false" + :expected false + :actual (equal :apple :pear) }) + (t {:given "equal bools" + :should "be true" + :expected true + :actual (equal true true) }) + (t {:given "different strings" + :should "be false" + :expected false + :actual (equal true false) }) + (test-end)))) -- cgit 1.4.1-2-gfad0