Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing -preview versions in the registry when installed via Visual Studio #1914

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export class VersionResolver implements IVersionResolver {
*/
private getPatchVersionString(fullySpecifiedVersion : string) : string
{
const patch : string | undefined = fullySpecifiedVersion.split('.')?.at(2)?.substring(1);
const patch : string | undefined = fullySpecifiedVersion.split('.')?.at(2)?.substring(1).split('-')?.at(0);
nagilson marked this conversation as resolved.
Show resolved Hide resolved
if(patch === undefined || !this.isNumber(patch))
{
const event = new DotnetFeatureBandDoesNotExistError(new EventCancellationError('DotnetFeatureBandDoesNotExistError',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ suite('VersionResolver Unit Tests', () => {
assert.equal(resolver.getFeatureBandPatchVersion(twoDigitPatchVersion), '21');
});

test('Get Patch from SDK Preview Version', async () => {
assert.equal(resolver.getFeatureBandPatchVersion('8.0.400-preview.0.24324.5'), '0');
});

test('Detects Unspecified Patch Version', async () => {
assert.equal(resolver.isNonSpecificFeatureBandedVersion(fullySpecifiedVersion), false, 'It detects versions with patches');
assert.equal(resolver.isNonSpecificFeatureBandedVersion(featureBandVersion), true, 'It detects versions with xx');
Expand Down