From c6fd797f8d946de2ff829c9aca90ff31a308d7fc Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 1 May 2025 18:33:27 +0100 Subject: [PATCH] Fixes issue with tag concatenation causing default platform to override platforms --- src/manage/tagutils.py | 2 +- tests/test_tagutils.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/manage/tagutils.py b/src/manage/tagutils.py index 8ea2cdf..b31fc39 100644 --- a/src/manage/tagutils.py +++ b/src/manage/tagutils.py @@ -185,7 +185,7 @@ def is_core(self): def __add__(self, other): if isinstance(other, str): - return type(self)(self._company, self.tag + other) + return type(self)(self._company, self.tag + self.platform + other) return NotImplemented def match(self, pattern): diff --git a/tests/test_tagutils.py b/tests/test_tagutils.py index 001a352..9f5a5f8 100644 --- a/tests/test_tagutils.py +++ b/tests/test_tagutils.py @@ -129,3 +129,9 @@ def test_tag_range_company(): assert not TagRange(r">=Company\3.10").satisfied_by(CompanyTag("OtherCompany", "3.10")) assert TagRange("=Company\\").satisfied_by(CompanyTag("Company", "3.11")) + + +def test_tag_concatenate(): + assert CompanyTag("3.13") + "-64" == CompanyTag("3.13-64") + assert CompanyTag("3.13-64") + "-64" == CompanyTag("3.13-64-64") + assert CompanyTag("3.13-arm64") + "-64" == CompanyTag("3.13-arm64-64")