Skip to content
Snippets Groups Projects
Unverified Commit 8fb6a457 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(versioning/swift): support dependencies with v prefix tags (#28822)

parent 9e34bd72
No related branches found
Tags 37.340.3
No related merge requests found
......@@ -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);
});
......@@ -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}
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment