You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2025/02/03 11:51:48 UTC
(maven) branch alpha created (now a2f345cf25)
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a change to branch alpha
in repository https://gitbox.apache.org/repos/asf/maven.git
at a2f345cf25 Test comparing letters to numbers
This branch includes the following new commits:
new a2f345cf25 Test comparing letters to numbers
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(maven) 01/01: Test comparing letters to numbers
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch alpha
in repository https://gitbox.apache.org/repos/asf/maven.git
commit a2f345cf2500a8a495992cb272671652df81882c
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Mon Feb 3 06:51:36 2025 -0500
Test comparing letters to numbers
---
.../maven/artifact/versioning/ComparableVersionTest.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/compat/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java b/compat/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
index da4c247baa..18dc8c92d4 100644
--- a/compat/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
+++ b/compat/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
@@ -236,6 +236,17 @@ void testGetCanonical() {
assertEquals("0.2", version2.getCanonical());
}
+ @Test
+ void testCompareDigitToLetter() {
+ ComparableVersion c1 = new ComparableVersion("7");
+ ComparableVersion c2 = new ComparableVersion("J");
+ ComparableVersion c3 = new ComparableVersion("c");
+ assertTrue(c1.compareTo(c2) > 0, "expected 7 > J");
+ assertTrue(c2.compareTo(c1) < 0, "expected J < 1");
+ assertTrue(c1.compareTo(c3) > 0, "expected 7 > c");
+ assertTrue(c3.compareTo(c1) < 0, "expected c < 7");
+ }
+
/**
* Test <a href="https://issues.apache.org/jira/browse/MNG-5568">MNG-5568</a> edge case
* which was showing transitive inconsistency: since A > B and B > C then we should have A > C