Fix #2327 - fix bug in dependency context adding assets to wrong groups
This commit is contained in:
parent
29183b045e
commit
bfdedfd75c
2 changed files with 39 additions and 2 deletions
|
@ -37,6 +37,41 @@ namespace Microsoft.Extensions.DependencyModel.Tests
|
|||
context.Target.Runtime.Should().Be("osx.10.10-x64");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GroupsRuntimeAssets()
|
||||
{
|
||||
var context = Read(@"
|
||||
{
|
||||
""targets"": {
|
||||
"".NETStandard,Version=v1.5"": {
|
||||
""System.Banana/1.0.0"": {
|
||||
""runtimeTargets"": {
|
||||
""runtimes/unix/Banana.dll"": { ""rid"": ""unix"", ""assetType"": ""runtime"" },
|
||||
""runtimes/win7/Banana.dll"": { ""rid"": ""win7"", ""assetType"": ""runtime"" },
|
||||
|
||||
""runtimes/native/win7/Apple.dll"": { ""rid"": ""win7"", ""assetType"": ""native"" },
|
||||
""runtimes/native/unix/libapple.so"": { ""rid"": ""unix"", ""assetType"": ""native"" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
""libraries"": {
|
||||
""System.Banana/1.0.0"": {
|
||||
""type"": ""package"",
|
||||
""serviceable"": false,
|
||||
""sha512"": ""HASH-System.Banana""
|
||||
},
|
||||
}
|
||||
}");
|
||||
context.RuntimeLibraries.Should().HaveCount(1);
|
||||
var runtimeLib = context.RuntimeLibraries.Single();
|
||||
runtimeLib.RuntimeAssemblyGroups.Should().HaveCount(2);
|
||||
runtimeLib.RuntimeAssemblyGroups.All(g => g.AssetPaths.Count == 1).Should().BeTrue();
|
||||
|
||||
runtimeLib.NativeLibraryGroups.Should().HaveCount(2);
|
||||
runtimeLib.NativeLibraryGroups.All(g => g.AssetPaths.Count == 1).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SetsPortableIfRuntimeTargetHasNoRid()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue