diff options
-rw-r--r-- | pym/portage/dep/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/tests/dep/test_use_reduce.py | 26 |
2 files changed, 11 insertions, 17 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index da67dd1fe..d9f6a2155 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -477,7 +477,7 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i #In opconvert mode, we have to move the operator from the level #above into the current list. stack[level].pop() - stack[level].extend(["||"] + l) + stack[level].append(["||"] + l) else: special_append() diff --git a/pym/portage/tests/dep/test_use_reduce.py b/pym/portage/tests/dep/test_use_reduce.py index b9a2b3dd3..162d7cdf2 100644 --- a/pym/portage/tests/dep/test_use_reduce.py +++ b/pym/portage/tests/dep/test_use_reduce.py @@ -276,19 +276,19 @@ class UseReduce(TestCase): UseReduceTestCase( "|| ( A B )", opconvert = True, - expected_result = ["||", "A", "B"]), + expected_result = [['||', 'A', 'B']]), UseReduceTestCase( "|| ( ( A B ) C )", opconvert = True, - expected_result = [ "||", ["A", "B"], "C" ]), + expected_result = [['||', ['A', 'B'], 'C']]), UseReduceTestCase( "|| ( A || ( B C ) )", opconvert = True, - expected_result = ["||", "A", "B", "C"]), + expected_result = [['||', 'A', 'B', 'C']]), UseReduceTestCase( "|| ( A || ( B C D ) )", opconvert = True, - expected_result = ["||", "A", "B", "C", "D"]), + expected_result = [['||', 'A', 'B', 'C', 'D']]), UseReduceTestCase( "|| ( A || ( B || ( C D ) E ) )", expected_result = [ "||", ["A", "B", "C", "D", "E"] ]), @@ -299,17 +299,11 @@ class UseReduce(TestCase): UseReduceTestCase( "( || ( || ( ( A ) B ) ) )", opconvert = True, - expected_result = ["||", "A", "B"]), + expected_result = [['||', 'A', 'B']]), UseReduceTestCase( - "( || ( || ( ( A ) B ) ) )", + "|| ( A B ) C", opconvert = True, - expected_result = ["||", "A", "B"]), - - # ['||', 'A', 'B', 'C'] != [['||', 'A', 'B'], 'C'] - #UseReduceTestCase( - # "|| ( A B ) C", - # opconvert = True, - # expected_result = [['||', 'A', 'B'], 'C']), + expected_result = [['||', 'A', 'B'], 'C']), # ['A', '||', ['B', 'C']] != ['A', ['||', 'B', 'C']] #UseReduceTestCase( @@ -328,7 +322,7 @@ class UseReduce(TestCase): "( || ( || ( || ( A ) foo? ( B ) ) ) )", uselist = ["foo"], opconvert = True, - expected_result = ["||", "A", "B"]), + expected_result = [['||', 'A', 'B']]), UseReduceTestCase( "( || ( || ( bar? ( A ) || ( foo? ( B ) ) ) ) )", opconvert = True, @@ -337,7 +331,7 @@ class UseReduce(TestCase): "( || ( || ( bar? ( A ) || ( foo? ( B ) ) ) ) )", uselist = ["foo", "bar"], opconvert = True, - expected_result = ["||", "A", "B"]), + expected_result = [['||', 'A', 'B']]), UseReduceTestCase( "A || ( ) foo? ( ) B", opconvert = True, @@ -365,7 +359,7 @@ class UseReduce(TestCase): "|| ( ( A B ) foo? ( || ( C D ) ) )", uselist = ["foo"], opconvert = True, - expected_result = ['||', ['A', 'B'], 'C', 'D']), + expected_result = [['||', ['A', 'B'], '||', 'C', 'D']]), UseReduceTestCase( "|| ( ( A B ) foo? ( || ( C D ) ) )", |