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>
diff --git a/tests/scripts/generate_bignum_tests.py b/tests/scripts/generate_bignum_tests.py
index 8a8425e..b08ba37 100755
--- a/tests/scripts/generate_bignum_tests.py
+++ b/tests/scripts/generate_bignum_tests.py
@@ -166,7 +166,7 @@
"""
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 @@
test_name = "MPI add"
input_cases = cast(
List[Tuple[str, str]],
- list(itertools.combinations(
+ list(itertools.combinations_with_replacement(
[
"1c67967269c6", "9cde3",
"-1c67967269c6", "-9cde3",