aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-01-20 10:59:38 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2023-01-20 10:59:38 +0200
commit7c9f1da09e6660ba6f5eb4c677412c5c7c601c34 (patch)
treed160551b8e4957944c53396cd2c2ae70dfe82253 /tests/ebuild
parentrefactor(sync): Remove unused variable assignment. (diff)
downloadpkgcore-7c9f1da09e6660ba6f5eb4c677412c5c7c601c34.tar.gz
pkgcore-7c9f1da09e6660ba6f5eb4c677412c5c7c601c34.tar.bz2
pkgcore-7c9f1da09e6660ba6f5eb4c677412c5c7c601c34.zip
domain: support `-*` in use as previous removal
Add support for `-*` and `USE_EXPAND: -*` syntax. Allow this syntax, and update incremental computation of resulting use combination. Resolves: https://github.com/pkgcore/pkgcore/issues/393 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests/ebuild')
-rw-r--r--tests/ebuild/test_domain.py41
1 files changed, 32 insertions, 9 deletions
diff --git a/tests/ebuild/test_domain.py b/tests/ebuild/test_domain.py
index e7b93b11..54aa8f36 100644
--- a/tests/ebuild/test_domain.py
+++ b/tests/ebuild/test_domain.py
@@ -57,15 +57,17 @@ class TestDomain:
def test_use_expand_syntax(self):
(self.pusedir / "a").write_text(
- textwrap.dedent(
- """
- */* x_y1
- # unrelated is there to verify that it's unaffected by the USE_EXPAND
- */* unrelated X: -y1 y2
- # multiple USE_EXPANDs
- */* unrelated X: -y1 y2 Z: -z3 z4
- """
- )
+ """
+ */* x_y1
+ # unrelated is there to verify that it's unaffected by the USE_EXPAND
+ */* unrelated X: -y1 y2
+ # multiple USE_EXPANDs
+ */* unrelated X: -y1 y2 Z: -z3 z4
+ # cleanup previous
+ */* x y -* z
+ # cleanup previous USE_EXPAND
+ */* unrelated Y: y1 -* y2 Z: z1 -* -z2
+ """
)
assert (
@@ -91,6 +93,27 @@ class TestDomain:
),
),
),
+ (
+ packages.AlwaysTrue,
+ (
+ ("*",),
+ ("z",),
+ ),
+ ),
+ (
+ packages.AlwaysTrue,
+ (
+ (
+ "y_*",
+ "z_*",
+ "z_z2",
+ ),
+ (
+ "unrelated",
+ "y_y2",
+ ),
+ ),
+ ),
) == self.mk_domain().pkg_use
def test_use_flag_parsing_enforcement(self, caplog):