Hi there @martinklepsch, I am building up some unit tests - when you have a moment I have a few questions. 🙂
I am looking at your playground test area under test-sources
. I see stuff that is obviously useful for tests, but am unsure about other stuff. Like https://github.com/cljdoc/codox/blob/b29b16ae686e3400689bbdc93df57200b709443d/codox/test-sources/codox_test/macro.cljc#L11 this behaves differently under clj and cljs and am wondering if it merits an automated test of some sort.
Also.. I see specs https://github.com/cljdoc/codox/blob/cljs-proper/codox/test-sources/codox_test/spec.cljc and https://github.com/cljdoc/codox/blob/cljs-proper/codox/test-sources/codox_test/spec_two.cljs - what’s the expectation for those?
These were created to reproduce one particular issue that ultimately didn't have to do anything with spec, don't recall the details right now but probably fine to ignore/delete for now
Ok, thanks!
And… what is expectation for records? https://github.com/cljdoc/codox/blob/cljs-proper/codox/test-sources/codox_test/record.cljc
For records, I think the intent might be to exclude them from docs (is this the config you use? https://github.com/cljdoc/cljdoc/blob/139a5a6c8094ef05cde24b93ef942b0882dbb22f/modules/analysis-runner/resources/impl.clj.tpl#L24). This does exclude them from Clojure but only partially excludes them from ClojureScript. This might be why I see a cljs only records up on cljdoc, for example: https://cljdoc.org/d/metosin/reitit-ring/0.3.1/api/reitit.coercion#CoercionError
For records we filter out the automatically generated constructor functions (->Record, map->Record), the record itself should be listed. That it is not in Clojure seems like a bug.
Thanks. Ah I got it backwards. Ok, I will see if there is a clear and easy fix, if not I will raise a separate git issue.
Oh wait... let me make sure I understand... So for
(defrecord Foo [a b])
(def bar (->Foo 1 2))
You would expect to see both Foo and bar in docs?Yes, that's correct
because bar
is just like any other var
Thanks, I think I got confused about which one was considered a record.
user=> (record? Foo)
false
user=> (record? bar)
true