Skip to content

Commit

Permalink
fix(versioning/swift): support dependencies with v prefix tags (#28822)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored May 3, 2024
1 parent 9e34bd7 commit 8fb6a45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/modules/versioning/swift/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ describe('modules/versioning/swift/index', () => {
version | expected
${'from: "1.2.3"'} | ${false}
${'1.2.3'} | ${true}
${'v1.2.3'} | ${true}
${'a'} | ${false}
`('isVersion("$version") === $expected', ({ version, expected }) => {
expect(!!isVersion(version)).toBe(expected);
});
Expand Down Expand Up @@ -99,6 +101,7 @@ describe('modules/versioning/swift/index', () => {
it.each`
version | range | expected
${'1.2.3'} | ${'1.2.3'} | ${true}
${'v1.2.3'} | ${'1.2.3'} | ${true}
${'1.2.4'} | ${'..."1.2.4"'} | ${true}
${'v1.2.4'} | ${'..."1.2.4"'} | ${true}
${'1.2.4'} | ${'..."1.2.3"'} | ${false}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/versioning/swift/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function isLessThanRange(version: string, range: string): boolean {

function matches(version: string, range: string): boolean {
// Check if both are an exact version
if (valid(range) && version === range) {
if (isVersion(range) && equals(version, range)) {
return true;
}
const semverRange = toSemverRange(range);
Expand Down

0 comments on commit 8fb6a45

Please sign in to comment.