diff --git a/lib/modules/manager/gradle/utils.spec.ts b/lib/modules/manager/gradle/utils.spec.ts index b9dee3369c2106225b2468defd7443dae6a8c8d7..5f11992b052e10ffaa94f2408224c9982575e189 100644 --- a/lib/modules/manager/gradle/utils.spec.ts +++ b/lib/modules/manager/gradle/utils.spec.ts @@ -37,10 +37,10 @@ describe('modules/manager/gradle/utils', () => { it('isDependencyString', () => { expect(isDependencyString('foo:bar:1.2.3')).toBeTrue(); expect(isDependencyString('foo.foo:bar.bar:1.2.3')).toBeTrue(); - expect(isDependencyString('foo:bar:baz:qux')).toBeFalse(); + expect(isDependencyString('foo:bar:baz:qux')).toBeTrue(); expect(isDependencyString('foo.bar:baz:1.2.3')).toBeTrue(); expect(isDependencyString('foo.bar:baz:1.2.+')).toBeTrue(); - expect(isDependencyString('foo.bar:baz:qux:quux')).toBeFalse(); + expect(isDependencyString('foo:bar:baz:qux:quux')).toBeFalse(); expect(isDependencyString("foo:bar:1.2.3'")).toBeFalse(); expect(isDependencyString('foo:bar:1.2.3"')).toBeFalse(); expect(isDependencyString('-Xep:ParameterName:OFF')).toBeFalse(); @@ -56,7 +56,10 @@ describe('modules/manager/gradle/utils', () => { depName: 'foo.foo:bar.bar', currentValue: '1.2.3', }); - expect(parseDependencyString('foo:bar:baz:qux')).toBeNull(); + expect(parseDependencyString('foo:bar:baz:qux')).toMatchObject({ + depName: 'foo:bar', + currentValue: 'baz', + }); expect(parseDependencyString('foo.bar:baz:1.2.3')).toMatchObject({ depName: 'foo.bar:baz', currentValue: '1.2.3', @@ -65,7 +68,7 @@ describe('modules/manager/gradle/utils', () => { depName: 'foo:bar', currentValue: '1.2.+', }); - expect(parseDependencyString('foo.bar:baz:qux:quux')).toBeNull(); + expect(parseDependencyString('foo:bar:baz:qux:quux')).toBeNull(); expect(parseDependencyString("foo:bar:1.2.3'")).toBeNull(); expect(parseDependencyString('foo:bar:1.2.3"')).toBeNull(); expect(parseDependencyString('-Xep:ParameterName:OFF')).toBeNull(); diff --git a/lib/modules/manager/gradle/utils.ts b/lib/modules/manager/gradle/utils.ts index 8e4ce240b6d569f80ffffa96c2160f7eceb34552..5415124f2bbc39275c36aef97333d1b8812ada32 100644 --- a/lib/modules/manager/gradle/utils.ts +++ b/lib/modules/manager/gradle/utils.ts @@ -26,7 +26,7 @@ export function versionLikeSubstring( export function isDependencyString(input: string): boolean { const split = input?.split(':'); - if (split?.length !== 3) { + if (split?.length !== 3 && split?.length !== 4) { return false; } // eslint-disable-next-line prefer-const