Add some more unit tests for version comparisons:

x.y.z-alphanumeric < x.y.z < x.y.z-numeric

and x.y.z-A  < x.y.z-B where A is before B in the alphabeth.

This was triggered by a user question on the dev list, and took unit
tests to answer the question - committing as 'documentation'.



git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@414014 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kenney Westerhof 2006-06-14 01:05:43 +00:00
parent 46487ceb4f
commit 7ba2f9fe2e
1 changed files with 12 additions and 0 deletions

View File

@ -237,5 +237,17 @@ public class DefaultArtifactVersionTest
version = new DefaultArtifactVersion( "2.0-1" );
assertTrue( version.compareTo( new DefaultArtifactVersion( "2.0.1" ) ) < 0 );
version = new DefaultArtifactVersion( "2.0.1-klm" );
assertTrue( version.compareTo( new DefaultArtifactVersion( "2.0.1-lmn" ) ) < 0 );
version = new DefaultArtifactVersion( "2.0.1-xyz" );
assertTrue( version.compareTo( new DefaultArtifactVersion( "2.0.1" ) ) < 0 );
version = new DefaultArtifactVersion( "2.0.1" );
assertTrue( version.compareTo( new DefaultArtifactVersion( "2.0.1-123" ) ) < 0 );
version = new DefaultArtifactVersion( "2.0.1-xyz" );
assertTrue( version.compareTo( new DefaultArtifactVersion( "2.0.1-123" ) ) < 0 );
}
}