Skip to content

Commit 9995bb9

Browse files
committed
Update package prune tests
1 parent 32ba783 commit 9995bb9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/Microsoft.NET.Build.Tests/GivenThatWeWantToResolveConflicts.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,11 @@ public void PlatformPackagesCanBePruned(bool prunePackages)
331331
[InlineData("net451", false)]
332332
[InlineData("net462")]
333333
[InlineData("net481")]
334-
[InlineData("net9.0", true, "")]
335-
[InlineData("netstandard2.1", true, "")]
334+
// These target frameworks shouldn't prune packages unless explicitly enabled
335+
[InlineData("net9.0", false, "")]
336+
[InlineData("netstandard2.1", false, "")]
337+
// .NET 10 and up should prune packages by default
338+
[InlineData("net10.0", true, "")]
336339
public void PrunePackageDataSucceeds(string targetFramework, bool shouldPrune = true, string enablePackagePruning = "True")
337340
{
338341
var nugetFramework = NuGetFramework.Parse(targetFramework);
@@ -393,7 +396,7 @@ List<KeyValuePair<string,string>> GetPrunedPackages(string frameworkReference)
393396
prunedPackages.Should().BeEmpty();
394397
}
395398

396-
if (nugetFramework.Framework.Equals(".NETCoreApp", StringComparison.OrdinalIgnoreCase) && nugetFramework.Version.Major >= 3)
399+
if (shouldPrune && nugetFramework.Framework.Equals(".NETCoreApp", StringComparison.OrdinalIgnoreCase) && nugetFramework.Version.Major >= 3)
397400
{
398401
foreach(var frameworkReference in new [] {
399402
"Microsoft.AspNetCore.App",

0 commit comments

Comments
 (0)