From 35bcc0ab3ac754e9f2ce6465c3d5c060bd5d37aa Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 8 Nov 2020 22:02:54 +0300 Subject: feature(core): add metadata based type inspection for tables, and empty macro --- test/macros.fnl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/macros.fnl') diff --git a/test/macros.fnl b/test/macros.fnl index 638a29d..53de853 100644 --- a/test/macros.fnl +++ b/test/macros.fnl @@ -135,3 +135,10 @@ (assert-eq (meta x) (when-meta {:fnl/docstring "x"})) (defonce {:doc "y" :dynamic true} y 20) (assert-eq (meta y) (when-meta {:fnl/docstring "y"})))) + +(deftest empty + (testing empty + (assert-eq (empty {}) {}) + (assert-eq (empty []) {}) + (assert-eq (getmetatable (empty [])) {:cljlib/table-type :seq}) + (assert-eq (getmetatable (empty {})) {:cljlib/table-type :table}))) -- cgit v1.2.3