Skip to content

Commit

Permalink
Package deprecation should be case insensitive on version (#10243)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen authored Oct 30, 2024
1 parent 1593e94 commit d6ff752
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
Expand Down Expand Up @@ -148,7 +148,7 @@ public async Task<UpdateDeprecationError> UpdateDeprecation(
foreach (var version in versions)
{
var normalizedVersion = NuGetVersionFormatter.Normalize(version);
var package = packages.SingleOrDefault(v => v.NormalizedVersion == normalizedVersion);
var package = packages.SingleOrDefault(v => StringComparer.OrdinalIgnoreCase.Equals(v.NormalizedVersion, normalizedVersion));
if (package == null)
{
return new UpdateDeprecationError(
Expand Down Expand Up @@ -181,4 +181,4 @@ await _deprecationService.UpdateDeprecation(
return null;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
Expand Down Expand Up @@ -856,7 +856,7 @@ private async Task AssertSuccessful(

var package2 = new Package
{
NormalizedVersion = "1.0.0",
NormalizedVersion = "1.0.0-RC1",
PackageRegistration = registration
};

Expand Down Expand Up @@ -932,7 +932,7 @@ private async Task AssertSuccessful(

var service = GetService<PackageDeprecationManagementService>();

var packageNormalizedVersions = new[] { package.NormalizedVersion, package2.NormalizedVersion };
var packageNormalizedVersions = new[] { package.NormalizedVersion, package2.NormalizedVersion.ToLowerInvariant() };

// Act
var result = await InvokeUpdateDeprecation(
Expand Down Expand Up @@ -981,4 +981,4 @@ private static Task<UpdateDeprecationError> InvokeUpdateDeprecation(
}
}
}
}
}

0 comments on commit d6ff752

Please sign in to comment.