- The
cljs.test/is
macro callscljs.test/try-expr
macro in the same compilation stage. While this can be done in Clojure, it can't be done in ClojureScript where macros must be defined in a different stage than consumed. The fix is to build a tower (and the functions used by the macro at the top of that tower—function?
,assert-predicate
, etc.—can be moved to be there). (See http://blog.fikesfarm.com/posts/2015-12-18-clojurescript-macro-tower-and-loop.html) - The
cljs.test
macros make use of thecljs.analyzer.api
Clojure namespace. The few needed functions can be copied over into a ClojureScript namespace. - The
cljs.test
macros make use of Clojure code in theclojure.template
namespace. Solved by copying to ClojureScript namespaces. - There is some code in the
deftest
macro that, in Clojure makes use ofvar
in a dynamic fashion. I updated this to make use of Planck'seval
capability to evaluate the samevar
form at runtime. I also associated the vars with thedeftest
symbols in a different way than the original implementation, keeping a map in an atom. - There were a few spots that threw
IllegalArgumentException
orException
. Converted to make exceptions usingex-info
. - The entire commit is here https://github.com/mfikes/planck/commit/21dddf244030cae1917fd735513fb8b5adb8409f
- I found that I had to make use of
:static-fns
to load (and AOT compile) the resultingcljs.test
macros in order to work around the perf bug mentioned here http://blog.fikesfarm.com/posts/2015-11-03-planck-static-function-dispatch.html otherwise it would actually crash JavaScriptCore
Note, the use of Planck's eval
is not necessary, see https://github.com/mfikes/planck/commit/bed0734a5177fbfcc964a5f9763a8b6007141e2f