mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(maven): Correct order for versions with different length (#13552)
This commit is contained in:
parent
fe72cd75c6
commit
68dfc27f39
2 changed files with 8 additions and 1 deletions
|
@ -177,6 +177,13 @@ describe('versioning/maven/compare', () => {
|
||||||
${'1-milestone'} | ${'1-snapshot'}
|
${'1-milestone'} | ${'1-snapshot'}
|
||||||
${'1-abc'} | ${'1-xyz'}
|
${'1-abc'} | ${'1-xyz'}
|
||||||
${'Hoxton.RELEASE'} | ${'Hoxton.SR1'}
|
${'Hoxton.RELEASE'} | ${'Hoxton.SR1'}
|
||||||
|
${'2.0'} | ${'2.0-PFD2'}
|
||||||
|
${'2.0'} | ${'2.0.SP1'}
|
||||||
|
${'2.0-PFD2'} | ${'2.0.SP1'}
|
||||||
|
${'1.3.9'} | ${'1.3.9.fix-log4j2'}
|
||||||
|
${'1-0.alpha'} | ${'1'}
|
||||||
|
${'1-0.beta'} | ${'1'}
|
||||||
|
${'1-0.alpha'} | ${'1-0.beta'}
|
||||||
`('$x < $y', ({ x, y }) => {
|
`('$x < $y', ({ x, y }) => {
|
||||||
expect(compare(x, y)).toBe(-1);
|
expect(compare(x, y)).toBe(-1);
|
||||||
expect(compare(y, x)).toBe(1);
|
expect(compare(y, x)).toBe(1);
|
||||||
|
|
|
@ -140,7 +140,7 @@ function tokenize(versionStr: string, preserveMinorZeroes = false): Token[] {
|
||||||
}
|
}
|
||||||
|
|
||||||
function nullFor(token: Token): Token {
|
function nullFor(token: Token): Token {
|
||||||
return token.prefix === PREFIX_DOT
|
return token.type === TYPE_NUMBER
|
||||||
? {
|
? {
|
||||||
prefix: token.prefix,
|
prefix: token.prefix,
|
||||||
type: TYPE_NUMBER,
|
type: TYPE_NUMBER,
|
||||||
|
|
Loading…
Reference in a new issue