spec.py: fix comparison with multivalued variants (#47485)
This commit is contained in:
parent
bf11fb037b
commit
0d817878ea
@ -1975,3 +1975,7 @@ def test_equality_discriminate_on_propagation(lhs, rhs):
|
||||
s, t = Spec(lhs), Spec(rhs)
|
||||
assert s != t
|
||||
assert len({s, t}) == 2
|
||||
|
||||
|
||||
def test_comparison_multivalued_variants():
|
||||
assert Spec("x=a") < Spec("x=a,b") < Spec("x==a,b") < Spec("x==a,b,c")
|
||||
|
@ -378,8 +378,8 @@ def _value_setter(self, value: ValueType) -> None:
|
||||
|
||||
def _cmp_iter(self) -> Iterable:
|
||||
yield self.name
|
||||
yield from (str(v) for v in self.value_as_tuple)
|
||||
yield self.propagate
|
||||
yield from (str(v) for v in self.value_as_tuple)
|
||||
|
||||
def copy(self) -> "AbstractVariant":
|
||||
"""Returns an instance of a variant equivalent to self
|
||||
|
Loading…
Reference in New Issue
Block a user