From 859cf1388770f65d31002d3667977d6760c2e092 Mon Sep 17 00:00:00 2001 From: Andrey Listopadov Date: Thu, 22 Jul 2021 22:35:49 +0300 Subject: release: v0.5.4 --- tests/core.fnl | 1 - tests/fn.fnl | 40 ++++++++++++++++++++-------------------- tests/macros.fnl | 19 ++++++++++--------- 3 files changed, 30 insertions(+), 30 deletions(-) (limited to 'tests') diff --git a/tests/core.fnl b/tests/core.fnl index d759fe4..ab3b08a 100644 --- a/tests/core.fnl +++ b/tests/core.fnl @@ -446,7 +446,6 @@ (assert-eq (vals {:a 1}) [1]) (match (pcall #(assert-eq (keys {:a 1 :b 2 :c 3}) (hash-set :a :b :c))) (false msg) (io.stderr:write "WARNING: " msg)) - (print "10") (match (pcall #(assert-eq (vals {:a 1 :b 2 :c 3}) (hash-set 1 2 3))) (false msg) (io.stderr:write "WARNING: " msg)) (assert-eq (find {:a 1 :b 2 :c 3} :c) [:c 3]) diff --git a/tests/fn.fnl b/tests/fn.fnl index 3517918..36fd395 100644 --- a/tests/fn.fnl +++ b/tests/fn.fnl @@ -7,56 +7,56 @@ "docstring" [x] x) (assert-eq (meta f) - (when-meta {:fnl/docstring "docstring" - :fnl/arglist ["([x])"]})) + {:fnl/docstring "docstring" + :fnl/arglist ["([x])"]}) (fn* f "docstring" []) (assert-eq (meta f) - (when-meta {:fnl/docstring "docstring" - :fnl/arglist ["([])"]})) + {:fnl/docstring "docstring" + :fnl/arglist ["([])"]}) (fn* f "docstring" ([x] x)) (assert-eq (meta f) - (when-meta {:fnl/docstring "docstring" - :fnl/arglist ["([x])"]})) + {:fnl/docstring "docstring" + :fnl/arglist ["([x])"]}) (fn* f "docstring" ([x] x) ([x y] (+ x y))) (assert-eq (meta f) - (when-meta {:fnl/docstring "docstring" - :fnl/arglist ["([x])" - "([x y])"]})) + {:fnl/docstring "docstring" + :fnl/arglist ["([x])" + "([x y])"]}) (fn* f "docstring" ([]) ([x y] (+ x y))) (assert-eq (meta f) - (when-meta {:fnl/docstring "docstring" - :fnl/arglist ["([])" - "([x y])"]})) + {:fnl/docstring "docstring" + :fnl/arglist ["([])" + "([x y])"]}) (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 ["([x])" - "([x y])" - "([x y & z])"]}))) + {:fnl/docstring "docstring" + :fnl/arglist ["([x])" + "([x y])" + "([x y & z])"]})) (testing "fn* doc destructuring" (fn* f [[a b c]]) (assert-eq (meta f) - (when-meta {:fnl/arglist ["([[a b c]])"]})) + {:fnl/arglist ["([[a b c]])"]}) (fn* f ([[a b c]]) ([{: a}]) ([[{:a [a b c]}]])) (assert-eq (meta f) - (when-meta {:fnl/arglist ["([[a b c]])" - "([{:a a}])" - "([[{:a [a b c]}]])"]}))) + {:fnl/arglist ["([[a b c]])" + "([{:a a}])" + "([[{:a [a b c]}]])"]})) (testing "fn* methods" (local ns {:a 1 :b 2}) diff --git a/tests/macros.fnl b/tests/macros.fnl index cf5c09b..50961d6 100644 --- a/tests/macros.fnl +++ b/tests/macros.fnl @@ -128,9 +128,9 @@ (testing "defmulti docstring" (defmulti f "documentation" (fn [x] x)) - (assert-eq (meta f) (when-meta {:fnl/docstring "documentation"})) + (assert-eq (meta f) {:fnl/docstring "documentation"}) (defmulti g "documentation" (fn [x] x) :default 0) - (assert-eq (meta g) (when-meta {:fnl/docstring "documentation"}))) + (assert-eq (meta g) {:fnl/docstring "documentation"})) (testing "defmulti with multiple arity" (defmulti f (fn* ([x] x) ([x y] [x y]))) @@ -170,21 +170,21 @@ (deftest meta (testing "with-meta" - (assert-eq (meta (with-meta :a {:k :v})) (when-meta {:k :v}))) + (assert-eq (meta (with-meta :a {:k :v})) {:k :v})) (testing "def meta" (def {:doc "x"} x 10) - (assert-eq (meta x) (when-meta {:fnl/docstring "x"})) + (assert-eq (meta x) {:fnl/docstring "x"}) (def {:doc "x" :mutable true} x 10) - (assert-eq (meta x) (when-meta {:fnl/docstring "x"}))) + (assert-eq (meta x) {:fnl/docstring "x"})) (testing "defonce meta table" (defonce {:doc "x"} x 10) - (assert-eq (meta x) (when-meta {:fnl/docstring "x"})) + (assert-eq (meta x) {:fnl/docstring "x"}) (defonce {:doc "y"} x 20) - (assert-eq (meta x) (when-meta {:fnl/docstring "x"})) + (assert-eq (meta x) {:fnl/docstring "x"}) (defonce {:doc "y" :mutable true} y 20) - (assert-eq (meta y) (when-meta {:fnl/docstring "y"})))) + (assert-eq (meta y) {:fnl/docstring "y"}))) (deftest empty (testing "empty map" @@ -246,7 +246,8 @@ (testing "multi-value results" (assert-eq 3 (select :# (try (values 1 2 3)))) (assert-eq [1 2 3] [(try (values 1 2 3))]) - (assert-eq 6 (select :# (try (values 1 nil 3 nil nil nil)))))) + (assert-eq 6 (select :# (try (values 1 nil 3 nil nil nil)))) + (assert-eq 6 (select :# (try (error 10) (catch _ (values 1 nil 3 nil nil nil))))))) (deftest loop (testing "loop macro" -- cgit v1.2.3