Benchmark changes

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
Merwane Hamadi
2023-09-12 12:10:03 -07:00
parent 978a980d72
commit 1b14d304d4
281 changed files with 428 additions and 718 deletions

View File

@@ -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)