diff options
| author | Andrey Orst <andreyorst@gmail.com> | 2021-01-19 16:46:00 +0000 |
|---|---|---|
| committer | Andrey Orst <andreyorst@gmail.com> | 2021-01-19 16:46:00 +0000 |
| commit | 92812d03922fd4c3ba85364b59e63236e7cfcd8a (patch) | |
| tree | 6504ecb114419b0dd3055e509abd8b602586f614 /tests/macros.fnl | |
| parent | a2b08f721c28b3b56a802031bc35df6a68b219d8 (diff) | |
| parent | 270beed0505ef47159d94fb162ff4840958f3ce5 (diff) | |
fix: Fennel 0.8.0 enhancements
Changelog:
- fixed bug in try
- reworked pretty printing for sets
- handle cycles in sets
- use new fennel.view format
- reorganized library to make requiring it easier
Diffstat (limited to 'tests/macros.fnl')
| -rw-r--r-- | tests/macros.fnl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/macros.fnl b/tests/macros.fnl index e387eb2..c3b54c9 100644 --- a/tests/macros.fnl +++ b/tests/macros.fnl @@ -1,5 +1,5 @@ (require-macros :tests.test) -(require-macros :cljlib-macros) +(require-macros :macros) (deftest into (testing "into" @@ -55,9 +55,9 @@ (let [a {} b []] (assert-eq (into a "vaiv") ["v" "a" "i" "v"]) - (assert-eq (into b "ваыв") ["в" "а" "ы" "в"])) + (when _G.utf8 (assert-eq (into b "ваыв") ["в" "а" "ы" "в"]))) (assert-eq (into [] "vaiv") ["v" "a" "i" "v"]) - (assert-eq (into [] "ваыв") ["в" "а" "ы" "в"]))) + (when _G.utf8 (assert-eq (into [] "ваыв") ["в" "а" "ы" "в"])))) (deftest let-variants (testing "when-let" @@ -89,7 +89,7 @@ (defmulti fac (fn [x] x)) (defmethod fac 0 [_] 1) (defmethod fac :default [x] (* x (fac (- x 1)))) - (assert-eq (fac 42) 7538058755741581312)) + (assert-eq (fac 4) 24)) (testing "defmulti keys" (defmulti send-data (fn [protocol data] protocol)) @@ -212,13 +212,13 @@ (assert-eq (try (+ 1 2 3 nil) (catch _) (finally 10)) nil)) (testing "catch-all" (assert-eq (try - (error 10) - (catch _ :pass)) - :pass) + (error "10") + (catch _ :pass)) + :pass) (assert-eq (try - (error 10) - (catch err err)) - 10)) + (error [10]) + (catch err err)) + [10])) (testing "finally" (let [tbl []] (try |