summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrey Orst <andreyorst@gmail.com>2020-11-17 20:43:37 +0300
committerAndrey Orst <andreyorst@gmail.com>2020-11-17 20:43:37 +0300
commit8a136eaa444f4569fced95fb175ca41b1e8e9b94 (patch)
tree65a3b02ff65150cb2f2e5656b98ab832be39f421 /tests
parent5753537138f6a0c71ddb6a8d9770b7cb13c1bd3f (diff)
feature: major overhaul of documentation, and some housekeeping
- remove(macros): `fn+` as it seem impractical, and `fn*` can be used instead - rename(def, defonce): `:dynamic` to `:mutable` as dynamic implies dynamic scoping which is not feature of Lua. - doc: generated documentation for macro module.
Diffstat (limited to 'tests')
-rw-r--r--tests/core.fnl3
-rw-r--r--tests/fn.fnl10
-rw-r--r--tests/macros.fnl10
3 files changed, 7 insertions, 16 deletions
diff --git a/tests/core.fnl b/tests/core.fnl
index 5dc4953..edd72f4 100644
--- a/tests/core.fnl
+++ b/tests/core.fnl
@@ -5,7 +5,8 @@
"Require module and bind all it's functions to locals."
`(local ,(let [destr-map# {}]
(each [k# _# (pairs (require module))]
- (tset destr-map# k# (sym k#)))
+ (when (not= (string.sub k# 1 1) :_)
+ (tset destr-map# k# (sym k#))))
destr-map#)
(require ,module)))
diff --git a/tests/fn.fnl b/tests/fn.fnl
index aa86b12..4381a60 100644
--- a/tests/fn.fnl
+++ b/tests/fn.fnl
@@ -32,13 +32,3 @@
:fnl/arglist ["\n ([x])"
"\n ([x y])"
"\n ([x y & z])"]}))))
-
-(deftest fn+
- (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) (when-meta {:fnl/docstring "docstring"
- :fnl/arglist ["..."]}))))
diff --git a/tests/macros.fnl b/tests/macros.fnl
index a9b41fe..29b5317 100644
--- a/tests/macros.fnl
+++ b/tests/macros.fnl
@@ -145,7 +145,7 @@
(deftest def-macros
(testing "def"
- (def {:dynamic true} a 10)
+ (def {:mutable true} a 10)
(assert-eq a 10)
(set a 20)
(assert-eq a 20)
@@ -154,12 +154,12 @@
(def a.b 10)
(assert-eq a.b 10)
(assert-eq b 10)
- (def :dynamic c 10)
+ (def :mutable c 10)
(set c 15)
(assert-eq c 15))
(testing "defonce"
- (defonce {:dynamic true} a 10)
+ (defonce {:mutable true} a 10)
(assert-eq a 10)
(defonce a {})
(assert-eq a 10)
@@ -175,7 +175,7 @@
(testing "def meta"
(def {:doc "x"} x 10)
(assert-eq (meta x) (when-meta {:fnl/docstring "x"}))
- (def {:doc "x" :dynamic true} x 10)
+ (def {:doc "x" :mutable true} x 10)
(assert-eq (meta x) (when-meta {:fnl/docstring "x"})))
(testing "defonce meta table"
@@ -183,7 +183,7 @@
(assert-eq (meta x) (when-meta {:fnl/docstring "x"}))
(defonce {:doc "y"} x 20)
(assert-eq (meta x) (when-meta {:fnl/docstring "x"}))
- (defonce {:doc "y" :dynamic true} y 20)
+ (defonce {:doc "y" :mutable true} y 20)
(assert-eq (meta y) (when-meta {:fnl/docstring "y"}))))
(deftest empty