Add SemanticVersion.valid? & SemanticVersion.parse?#15051
Add SemanticVersion.valid? & SemanticVersion.parse?#15051straight-shoota merged 6 commits intocrystal-lang:masterfrom
SemanticVersion.valid? & SemanticVersion.parse?#15051Conversation
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
straight-shoota
left a comment
There was a problem hiding this comment.
Actually, we should still have some basic specs to ensure the methods work.
|
@straight-shoota can you elaborate on what specifically? All the methods depend on the regex which is already tested in specs. |
|
Just a few simple calls to |
|
Can we get at least one successful test for each method? At the moment, even SemanticVersion.valid?("1.2.3").should be_true
SemanticVersion.parse?("1.2.3").should eq SemanticVersion.new(1, 2, 3) |
|
Hi @devnote-dev , thanks a lot for your contributions! We understand your reaction in this comment; having several rounds of reviews is tiring! Let me take a bit more of your time to understand what are we doing wrong. From our point of view, the comment suggesting specs was clear enough: "add successful and failing cases". Since only half of that was added in the subsequent commit, straight-shoota naturally asked for the other half. This seemed to not be excepcted, and therefore the reaction. First of all, and we need to make this more obvious to the contributors: whenever you're done with a PR, if you don't mind someone else taking over, you can leave it to us to do the final polish. And second, in order to improve future reviews, could you elaborate on why the first comment failed to transmit the expected outcome? Thanks once again for making Crystal better! |
|
@beta-ziliani Thank you for your acknowledgement. I don't mind having several rounds of reviews, but I do find these recent ones a bit unnecessary. I understand and support having full test coverage, but I also believe there's a point where testing is overdone. The I won't protest this issue as I've seen it become a blocker for valid contributions in the past, but I would like this issue to be taken into consideration for future contributions. |
|
@devnote-dev I agree it can feel repetitive or be over-testing, but such assumptions means that specs become implementation dependent. What if |
I wasn't sure if this required additional specs given that the underlying implementation (i.e. the regex) is the same. Closes #15020.