Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 079cb9b

Browse files
committed
test(nuget): add test to reproduce the issue
1 parent 884d927 commit 079cb9b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

source/Nuke.Tooling.Tests/NuGetPackageResolverTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ public void TestGetGlobalInstalledPackage()
4141
result.Version.OriginalVersion.Should().Be(XunitConsolePackageVersion);
4242
}
4343

44+
[Fact]
45+
public void TestGetGlobalInstalledPackageWithDuplicateNupkg()
46+
{
47+
var result = NuGetPackageResolver.GetGlobalInstalledPackage("coverlet.console", version: null, packagesConfigFile: null);
48+
// Null is the result as well, but it is inconclusive :(
49+
if (result != null)
50+
{
51+
result.Should().NotBeNull();
52+
result.Id.Should().Be("coverlet.console");
53+
result.File.Name.Should().EndWith("nupkg");
54+
// Do not check version as it is not deterministic
55+
}
56+
}
57+
4458
[Fact]
4559
public void TestGetLocalInstalledPackageViaProjectFile()
4660
{

0 commit comments

Comments
 (0)