diff options
| author | Andrey Listopadov <andreyorst@gmail.com> | 2021-07-23 21:41:22 +0300 |
|---|---|---|
| committer | Andrey Listopadov <andreyorst@gmail.com> | 2021-07-23 21:41:22 +0300 |
| commit | 5cd4100a4e9e7b7cf77b21f2759f6401cd9a06d9 (patch) | |
| tree | 684fed91c5f78fff1c0c242306541f4c5efe71c4 /tests/fn.fnl | |
| parent | 859cf1388770f65d31002d3667977d6760c2e092 (diff) | |
fix: don't generate mulitarity arglist doc for single-arity functions
Diffstat (limited to 'tests/fn.fnl')
| -rw-r--r-- | tests/fn.fnl | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/tests/fn.fnl b/tests/fn.fnl index 36fd395..a4b342b 100644 --- a/tests/fn.fnl +++ b/tests/fn.fnl @@ -4,46 +4,46 @@ (deftest fn* (testing "fn* meta" (fn* f - "docstring" + "single arity" [x] x) (assert-eq (meta f) - {:fnl/docstring "docstring" - :fnl/arglist ["([x])"]}) + {:fnl/docstring "single arity" + :fnl/arglist ["[x]"]}) (fn* f - "docstring" + "single empty arity" []) (assert-eq (meta f) - {:fnl/docstring "docstring" - :fnl/arglist ["([])"]}) + {:fnl/docstring "single empty arity" + :fnl/arglist ["[]"]}) (fn* f - "docstring" + "multiarity with single entry" ([x] x)) (assert-eq (meta f) - {:fnl/docstring "docstring" - :fnl/arglist ["([x])"]}) + {:fnl/docstring "multiarity with single entry" + :fnl/arglist ["[x]"]}) (fn* f - "docstring" + "multiarity" ([x] x) ([x y] (+ x y))) (assert-eq (meta f) - {:fnl/docstring "docstring" + {:fnl/docstring "multiarity" :fnl/arglist ["([x])" "([x y])"]}) (fn* f - "docstring" + "multiarity with one empty arity" ([]) ([x y] (+ x y))) (assert-eq (meta f) - {:fnl/docstring "docstring" + {:fnl/docstring "multiarity with one empty arity" :fnl/arglist ["([])" "([x y])"]}) (fn* f - "docstring" + "multiarity with two or more arity" ([x] x) ([x y] (+ x y)) ([x y & z] (+ x y))) (assert-eq (meta f) - {:fnl/docstring "docstring" + {:fnl/docstring "multiarity with two or more arity" :fnl/arglist ["([x])" "([x y])" "([x y & z])"]})) @@ -51,7 +51,10 @@ (testing "fn* doc destructuring" (fn* f [[a b c]]) (assert-eq (meta f) - {:fnl/arglist ["([[a b c]])"]}) + {:fnl/arglist ["[[a b c]]"]}) + (fn* f ([[a b c]])) + (assert-eq (meta f) + {:fnl/arglist ["[[a b c]]"]}) (fn* f ([[a b c]]) ([{: a}]) ([[{:a [a b c]}]])) (assert-eq (meta f) {:fnl/arglist ["([[a b c]])" |