Add datatype tests for empty#85
Conversation
| (defrecord Record [field]) | ||
| (deftype Type [field]) |
There was a problem hiding this comment.
Each test should try to use as few other clojure.core vars as possible, since those vars may not exist on whichever dialect is running test. On top of that, I'm not sure if every major Clojure dialect implements defrecord and deftype.
I think it's good thinking to add these, but I'm currently thinking this is doing too much for the empty test. Anyone have thoughts on that?
There was a problem hiding this comment.
yeah, that could be too much for empty test. In the other hand, we could add when-var-exists for defrecord and deftype to avoid the test from failing if those datatypes are not yet implemented
There was a problem hiding this comment.
definterface and defstruct aren't generic and are generally not included by dialects, but defrecord and deftype seem to have broad support (clojurescript, clojuredart, babashka, basilisp). I wouldn't think defrecord is any more special than range.
If you feel it necessary to bracket, then this portion of the test could be wrapped in (when-var-exists clojure.core/defrecord (testing "records" (defrecord Foo ...)))
There was a problem hiding this comment.
Given the somewhat rigid structure of the tests, I also have no idea where such a combination test would go if not here.
There was a problem hiding this comment.
Good thoughts, folks. Yeah, let's use a when-var-exists for each of these vars. Mainly, I want these tests to also serve as an onboarding ramp for new dialects (like jank), so ideally each test has the smallest footprint it can.
There was a problem hiding this comment.
@jeaye ok I just updated the pull request. Let me know if we need another change
There was a problem hiding this comment.
@rafonsecad So, we need to keep everything under the first when-var-exists check. Our new when-var-exists checks will be adding a new testing for records and a new testing for types. Know what I mean?
There was a problem hiding this comment.
@jeaye yeah that makes sense. check again please
jeaye
left a comment
There was a problem hiding this comment.
Looks good to me. @NoahTheDuke?
|
great! |
|
Thanks, @rafonsecad! |
Adding
emptytests on records as @NoahTheDuke suggested