Skip to content

Commit

Permalink
[MNG-6655] Add support for "release" qualifier
Browse files Browse the repository at this point in the history
This closes #249
  • Loading branch information
michael-o committed May 12, 2019
1 parent 2760e3e commit a92a61d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Expand Up @@ -33,7 +33,7 @@
* <p>
* Generic implementation of version comparison.
* </p>
*
*
* Features:
* <ul>
* <li>mixing of '<code>-</code>' (hyphen) and '<code>.</code>' (dot) separators,</li>
Expand Down Expand Up @@ -361,6 +361,7 @@ private static class StringItem
{
ALIASES.put( "ga", "" );
ALIASES.put( "final", "" );
ALIASES.put("release", "");
ALIASES.put( "cr", "rc" );
}

Expand Down
Expand Up @@ -135,6 +135,7 @@ public void testVersionsEqual()

// aliases
checkVersionsEqual( "1ga", "1" );
checkVersionsEqual( "1release", "1" );
checkVersionsEqual( "1final", "1" );
checkVersionsEqual( "1cr", "1rc" );

Expand All @@ -150,6 +151,9 @@ public void testVersionsEqual()
checkVersionsEqual( "1M", "1m" );
checkVersionsEqual( "1Ga", "1" );
checkVersionsEqual( "1GA", "1" );
checkVersionsEqual( "1RELEASE", "1" );
checkVersionsEqual( "1release", "1" );
checkVersionsEqual( "1RELeaSE", "1" );
checkVersionsEqual( "1Final", "1" );
checkVersionsEqual( "1FinaL", "1" );
checkVersionsEqual( "1FINAL", "1" );
Expand Down Expand Up @@ -229,7 +233,7 @@ public void testMng6572()

/**
* Test all versions are equal when starting with many leading zeroes regardless of string length
* (related to MNG-6572 optimization)
* (related to MNG-6572 optimization)
*/
public void testVersionEqualWithLeadingZeroes()
{
Expand All @@ -255,13 +259,13 @@ public void testVersionEqualWithLeadingZeroes()
"01",
"1"
};

checkVersionsArrayEqual( arr );
}

/**
* Test all "0" versions are equal when starting with many leading zeroes regardless of string length
* (related to MNG-6572 optimization)
* (related to MNG-6572 optimization)
*/
public void testVersionZeroEqualWithLeadingZeroes()
{
Expand All @@ -287,7 +291,7 @@ public void testVersionZeroEqualWithLeadingZeroes()
"00",
"0"
};

checkVersionsArrayEqual( arr );
}

Expand Down

0 comments on commit a92a61d

Please sign in to comment.