Use combinations_with_replacement for inputs

When generating combinations of values, `itertools.combinations` will
not allow inputs to be repeated. This is replaced so that cases where
input values match are generated, i.e. ("0", "0").

Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
Werner Lewis 2022-08-31 16:55:44 +01:00
parent 81f24443b7
commit a4b7720cb5

View file

@ -166,7 +166,7 @@ class BignumOperation(BignumTarget, metaclass=ABCMeta):
"""
yield from cast(
Iterator[Tuple[str, str]],
itertools.combinations(cls.input_values, 2)
itertools.combinations_with_replacement(cls.input_values, 2)
)
yield from cls.input_cases
@ -215,7 +215,7 @@ class BignumAdd(BignumOperation):
test_name = "MPI add"
input_cases = cast(
List[Tuple[str, str]],
list(itertools.combinations(
list(itertools.combinations_with_replacement(
[
"1c67967269c6", "9cde3",
"-1c67967269c6", "-9cde3",