diff options
Diffstat (limited to 'benchmark/agbenchmark/challenges/deprecated/code/3_modify/artifacts_out/test.py')
-rw-r--r-- | benchmark/agbenchmark/challenges/deprecated/code/3_modify/artifacts_out/test.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/benchmark/agbenchmark/challenges/deprecated/code/3_modify/artifacts_out/test.py b/benchmark/agbenchmark/challenges/deprecated/code/3_modify/artifacts_out/test.py new file mode 100644 index 000000000..5012e167a --- /dev/null +++ b/benchmark/agbenchmark/challenges/deprecated/code/3_modify/artifacts_out/test.py @@ -0,0 +1,29 @@ +from sample_code import multiply_int + + +def test_multiply_int(num: int, multiplier, expected_result: int) -> None: + result = multiply_int(num, multiplier) + print(result) + assert ( + result == expected_result + ), f"AssertionError: Expected the output to be {expected_result}" + + +if __name__ == "__main__": + # test the trivial case + num = 4 + multiplier = 2 + expected_result = 8 + test_multiply_int(num, multiplier, expected_result) + + # so its not hard coded + num = 7 + multiplier = 7 + expected_result = 49 + test_multiply_int(num, multiplier, expected_result) + + # negative numbers + num = -6 + multiplier = 2 + expected_result = -12 + test_multiply_int(num, multiplier, expected_result) |