You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2023/02/25 14:19:06 UTC
[GitHub] [maven] elharo commented on a diff in pull request #1014: [MNG-7700] test some edge cases with leading zeroes
elharo commented on code in PR #1014:
URL: https://github.com/apache/maven/pull/1014#discussion_r1117930896
##########
maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java:
##########
@@ -209,6 +208,26 @@ public void testVersionComparing() {
checkVersionsOrder("2.0.1-xyz", "2.0.1-123");
}
+ @Test
+ public void testLeadingZeroes() {
+ checkVersionsOrder("0.7", "2");
+ checkVersionsOrder("0.2", "1.0.7");
+ }
+
+ @Test
+ public void testGetCanonical() {
+ // MNG-7700
+ newComparable("0.x");
+ newComparable("0-x");
+ newComparable("0.rc");
+ newComparable("0-1");
+
+ ComparableVersion version = new ComparableVersion("0.x");
+ assertEquals("x", version.getCanonical());
Review Comment:
We never define or promise anything about the canonical representation of a ComparableVersion. Indeed, this method probably shouldn't have been public. All we promise is that two of them compare according to spec, and as best I can tell they do. For now this is just a characterization test of existing behavior. I'm leaving MNG-7700 open in case folks feel we should change the canonical representation. However neither that issue nor this PR needs to block the release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org