fix: join legacy settings with download selections

This commit is contained in:
codex
2026-08-05 15:54:40 +03:00
parent d6ed0ac592
commit 4c29c9084a
2 changed files with 79 additions and 0 deletions
@@ -31,6 +31,24 @@ public sealed class RosterAdaptersTests
Assert.False(selected.Roster.Packages[1].Enabled);
}
[Fact]
public void LegacySettingsAndDownloadList_JoinOnlyThroughExplicitOverlay()
{
const string settings = "<root><path><help>h</help><care>c</care></path><data><pattern><name>Plant</name><filter>*.dwg</filter><roster>r</roster></pattern><plugin><id>legacy-a</id><renewal>x</renewal><catalog>cat</catalog><install>load</install></plugin></data></root>";
const string selection = "<root><id>legacy-a</id></root>";
var adapter = new LegacyConfigurationAdapter();
var parsed = adapter.ParseSettings(settings);
var requirements = adapter.Join(parsed.Patterns[0], adapter.ParseDownloadList(selection), new("map-a", "Plant3D", 2026, "x64", false, [new("legacy-a", "PHIM.A", "1.0.0", "pilot")]));
Assert.Single(requirements); Assert.Equal("PHIM.A", requirements[0].PackageId);
}
[Fact]
public void LegacyDownloadList_DoesNotInventPluginMetadata()
{
var selection = new LegacyConfigurationAdapter().ParseDownloadList("<root><id>legacy-a</id></root>");
Assert.Equal(["legacy-a"], selection.PluginIds);
}
[Fact]
public void ProjectRoster_HasPriorityOverLegacy()
{