You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "michael-o (via GitHub)" <gi...@apache.org> on 2023/02/25 13:48:58 UTC

[GitHub] [maven] michael-o commented on a diff in pull request #1014: [MNG-7700] test some edge cases with leading zeroes

michael-o commented on code in PR #1014:
URL: https://github.com/apache/maven/pull/1014#discussion_r1117927578


##########
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:
   I still don't understand why this should not be 0 with `x` as qualifier.



-- 
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