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,16 @@
from sample_code import multiply_int
def test_multiply_int(num: int, expected_result: int) -> None:
result = multiply_int(num)
print(result)
assert (
result == expected_result
), f"AssertionError: Expected the output to be {expected_result}"
if __name__ == "__main__":
# test the trivial case
num = 4
expected_result = 8
test_multiply_int(num, expected_result)

View File

@@ -0,0 +1,3 @@
def multiply_int(num: int) -> int:
multiplied_num = num * 2
return multiplied_num

View File

@@ -0,0 +1,16 @@
from sample_code import multiply_int
def test_multiply_int(num: int, expected_result: int) -> None:
result = multiply_int(num)
print(result)
assert (
result == expected_result
), f"AssertionError: Expected the output to be {expected_result}"
if __name__ == "__main__":
# test the trivial case
num = 4
expected_result = 8
test_multiply_int(num, expected_result)

View File

@@ -0,0 +1,21 @@
{
"name": "TestReturnCodeWrite",
"category": ["code", "iterate"],
"task": "Add a function called multiply_int in sample_code.py that multiplies numbers by 2. You can make sure you have correctly done this by running test.py",
"dependencies": ["TestReturnCodeSimple"],
"cutoff": 120,
"ground": {
"answer": "Just a simple multiple by 2 function. Num is 4 so answer is 8",
"should_contain": ["8"],
"should_not_contain": [],
"files": ["test.py"],
"eval": {
"type": "python"
}
},
"info": {
"difficulty": "novice",
"description": "Small step up, just writing the function with a name as well as the return statement.",
"side_effects": []
}
}