mirror of
https://github.com/semver/semver.git
synced 2026-07-11 06:53:03 -05:00
[GH-ISSUE #388] Is that version comparison implementation correct? #1156
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @handicraftsman on GitHub (Aug 22, 2017).
Original GitHub issue: https://github.com/semver/semver/issues/388
@handicraftsman commented on GitHub (Aug 22, 2017):
Typedefs:
@FichteFoll commented on GitHub (Aug 22, 2017):
How about using unittests?
I used this earlier, though they are based on semver 2.0.0-rc.2 and therefore include ordering of metadata as well, but generally this is how you could do it.
a5f78ecc46/_test.py (L32-L50)(actual tests in line 70)
@handicraftsman commented on GitHub (Aug 23, 2017):
I am not actually familiar with unittests in C. So i am just using a test program. But i should really move to unittests for such stuff after finishing the whole semver implementation.
@jwdonahue commented on GitHub (Oct 11, 2018):
@handicraftsman said:
Many would argue that you should never have started without them.
The answer to your question is no, your logic is broken. You are trying to process the prerelease field as if it were a simple string of characters. That is incorrect. From the spec #11:
As you can see, you must identify the type of each identifier first, then apply the appropriate logic.
@jwdonahue commented on GitHub (Oct 11, 2018):
@handicraftsman , please take any further code reviews to Stackoverflow and use the semver tag and please close this issue at your earliest possible convenience.
@handicraftsman commented on GitHub (Oct 11, 2018):
Okay, sorry. Completely forgot about this issue ;shrugs;