added test cases

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@819001 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Herve Boutemy 2009-09-25 20:35:01 +00:00
parent ed18f8b7c6
commit 83626b8b03
1 changed files with 24 additions and 1 deletions

View File

@ -104,12 +104,19 @@ public class ComparableVersionTest
checkVersionsEqual( "1", "1-0" ); checkVersionsEqual( "1", "1-0" );
checkVersionsEqual( "1", "1.0-0" ); checkVersionsEqual( "1", "1.0-0" );
checkVersionsEqual( "1.0", "1.0-0" ); checkVersionsEqual( "1.0", "1.0-0" );
// no separator between number and character
checkVersionsEqual( "1a", "1.a" ); checkVersionsEqual( "1a", "1.a" );
checkVersionsEqual( "1a", "1-a" ); checkVersionsEqual( "1a", "1-a" );
checkVersionsEqual( "1a", "1.0-a" ); checkVersionsEqual( "1a", "1.0-a" );
checkVersionsEqual( "1a", "1.0.0-a" ); checkVersionsEqual( "1a", "1.0.0-a" );
checkVersionsEqual( "1.0a", "1.0.a" ); checkVersionsEqual( "1.0a", "1.0.a" );
checkVersionsEqual( "1.0.0a", "1.0.0.a" ); checkVersionsEqual( "1.0.0a", "1.0.0.a" );
checkVersionsEqual( "1x", "1.x" );
checkVersionsEqual( "1x", "1-x" );
checkVersionsEqual( "1x", "1.0-x" );
checkVersionsEqual( "1x", "1.0.0-x" );
checkVersionsEqual( "1.0x", "1.0.x" );
checkVersionsEqual( "1.0.0x", "1.0.0.x" );
// aliases // aliases
checkVersionsEqual( "1ga", "1" ); checkVersionsEqual( "1ga", "1" );
@ -120,6 +127,22 @@ public class ComparableVersionTest
checkVersionsEqual( "1a1", "1alpha1" ); checkVersionsEqual( "1a1", "1alpha1" );
checkVersionsEqual( "1b2", "1beta2" ); checkVersionsEqual( "1b2", "1beta2" );
checkVersionsEqual( "1m3", "1milestone3" ); checkVersionsEqual( "1m3", "1milestone3" );
// case insensitive
checkVersionsEqual( "1X", "1x" );
checkVersionsEqual( "1A", "1a" );
checkVersionsEqual( "1B", "1b" );
checkVersionsEqual( "1M", "1m" );
checkVersionsEqual( "1Ga", "1" );
checkVersionsEqual( "1GA", "1" );
checkVersionsEqual( "1Final", "1" );
checkVersionsEqual( "1FinaL", "1" );
checkVersionsEqual( "1FINAL", "1" );
checkVersionsEqual( "1Cr", "1Rc" );
checkVersionsEqual( "1cR", "1rC" );
checkVersionsEqual( "1m3", "1Milestone3" );
checkVersionsEqual( "1m3", "1MileStone3" );
checkVersionsEqual( "1m3", "1MILESTONE3" );
} }
public void testVersionComparing() public void testVersionComparing()