From aeab4d6df86538549f2f4a268b8addaad5ef267e Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 9 Nov 2020 21:28:49 +0300 Subject: feature(testing): change testing macro to contain description --- test/fn.fnl | 70 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) (limited to 'test/fn.fnl') diff --git a/test/fn.fnl b/test/fn.fnl index aae0382..f89581f 100644 --- a/test/fn.fnl +++ b/test/fn.fnl @@ -3,45 +3,43 @@ (require-macros :macros.fn) (deftest fn* - (when-meta - (testing fn*-meta - (fn* f - "docstring" - [x] x) - (assert-eq (meta f) {:fnl/docstring "docstring" - :fnl/arglist ["x"]}) + (testing "fn* meta" + (fn* f + "docstring" + [x] x) + (assert-eq (meta f) (when-meta {:fnl/docstring "docstring" + :fnl/arglist ["x"]})) - (fn* f - "docstring" - ([x] x)) - (assert-eq (meta f) {:fnl/docstring "docstring" - :fnl/arglist ["x"]}) + (fn* f + "docstring" + ([x] x)) + (assert-eq (meta f) (when-meta {:fnl/docstring "docstring" + :fnl/arglist ["x"]})) - (fn* f - "docstring" - ([x] x) - ([x y] (+ x y))) - (assert-eq (meta f) {:fnl/docstring "docstring" - :fnl/arglist ["\n [x]" - "\n [x y]"]}) + (fn* f + "docstring" + ([x] x) + ([x y] (+ x y))) + (assert-eq (meta f) (when-meta {:fnl/docstring "docstring" + :fnl/arglist ["\n [x]" + "\n [x y]"]})) - (fn* f - "docstring" - ([x] x) - ([x y] (+ x y)) - ([x y & z] (+ x y))) - (assert-eq (meta f) {:fnl/docstring "docstring" - :fnl/arglist ["\n [x]" - "\n [x y]" - "\n [x y & z]"]})))) + (fn* f + "docstring" + ([x] x) + ([x y] (+ x y)) + ([x y & z] (+ x y))) + (assert-eq (meta f) (when-meta {:fnl/docstring "docstring" + :fnl/arglist ["\n [x]" + "\n [x y]" + "\n [x y & z]"]})))) (deftest fn& - (when-meta - (testing fn&-meta - (fn& f "docstring" [x] x) - (assert-eq (meta f) {:fnl/docstring "docstring" - :fnl/arglist ["x"]}) + (testing "fn& meta" + (fn& f "docstring" [x] x) + (assert-eq (meta f) (when-meta {:fnl/docstring "docstring" + :fnl/arglist ["x"]})) - (fn& f "docstring" [...] [...]) - (assert-eq (meta f) {:fnl/docstring "docstring" - :fnl/arglist ["..."]})))) + (fn& f "docstring" [...] [...]) + (assert-eq (meta f) (when-meta {:fnl/docstring "docstring" + :fnl/arglist ["..."]})))) -- cgit v1.2.3