mirror of
https://github.com/semver/semver.git
synced 2026-07-11 06:53:03 -05:00
[GH-ISSUE #833] A list of examples with proper precedence to help writing unit tests. #2278
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 @NikolaiRuhe on GitHub (May 10, 2022).
Original GitHub issue: https://github.com/semver/semver/issues/833
Implementing a
SemVertype is somewhat complex. This is mostly due to some subtle precedence rules.To help with that it would be great to have a list of version strings to be used in unit tests. Ideally there would be...
These test tables should cover various edge cases and are designed to detect flaws in the implementation.
To illustrate what I mean I'll add some of my own tests (from a Swift implementation of SemVer):
@jwdonahue commented on GitHub (May 11, 2022):
Look for the thread(s) where we honed the example regex. You should find some valid and invalid examples.
@mark-wiemer commented on GitHub (Jul 18, 2022):
See https://regex101.com/r/vkijKf/1/. Not in precedence order, but otherwise a pretty good list.
@mrjbq7 commented on GitHub (Jan 24, 2023):
Should
1.0.0-rc3sort before or after1.0.0-rc12?@ljharb commented on GitHub (Jan 24, 2023):
i'd expect after, which is why usually one would do
1.0.0-rc.3vs1.0.0-rc.12, where i'd expect before.@steveklabnik commented on GitHub (Feb 6, 2023):
I would also support something like this; I wanted to make the
semvercrate from Rust's test suite operate on examples like this, but never got around to it.