diff options
| author | Andrey Orst <andreyorst@gmail.com> | 2020-10-26 20:57:22 +0300 |
|---|---|---|
| committer | Andrey Orst <andreyorst@gmail.com> | 2020-10-26 20:59:07 +0300 |
| commit | 1d2bba82b09710b0dc6ca4e1a515763088b3fbf5 (patch) | |
| tree | 9454e1ffcb40d33dff52ba83b88296686b28d2f6 /macros_test.fnl | |
| parent | cab42d9dbb162a6ca399d4d46dc20a5cbf4452ed (diff) | |
feature: refactoring
make some functions private (for coverage.sh)
Separate tests into one test per function (for coverage.sh)
Diffstat (limited to 'macros_test.fnl')
| -rw-r--r-- | macros_test.fnl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/macros_test.fnl b/macros_test.fnl index 7d3818a..aebde2e 100644 --- a/macros_test.fnl +++ b/macros_test.fnl @@ -39,19 +39,22 @@ b []] (assert-eq (into b {:a 1}) [[:a 1]]))) -(test let-variants +(test when-let (assert-eq (when-let [a 4] a) 4) (assert* (not (when-let [a false] a)) "(not (when-let [a false] a))") - (assert* (not (when-let [a nil] a)) "(not (when-let [a nil] a))") + (assert* (not (when-let [a nil] a)) "(not (when-let [a nil] a))")) +(test when-some (assert-eq (when-some [a [1 2 3]] a) [1 2 3]) (assert-eq (when-some [a false] a) false) - (assert* (not (when-some [a nil] a)) "(when-some [a nil] a)") + (assert* (not (when-some [a nil] a)) "(when-some [a nil] a)")) +(test if-let (assert-eq (if-let [a 4] a 10) 4) (assert-eq (if-let [a false] a 10) 10) - (assert-eq (if-let [a nil] a 10) 10) + (assert-eq (if-let [a nil] a 10) 10)) +(test if-some (assert-eq (if-some [a [1 2 3]] a :nothing) [1 2 3]) (assert-eq (if-some [a false] a :nothing) false) (assert-eq (if-some [a nil] a :nothing) :nothing)) |