2023-11-06 09:53:59 -05:00
|
|
|
def test(func: callable, params, expected_value, title: str, description = None):
|
2023-11-06 08:36:28 -05:00
|
|
|
print(title, end=" ")
|
2023-11-06 11:26:27 -05:00
|
|
|
value = func(*params)
|
|
|
|
if (value == expected_value):
|
2023-11-06 08:36:28 -05:00
|
|
|
print("[OK]")
|
|
|
|
return
|
|
|
|
print ("[ERROR]")
|
|
|
|
print ("expected", expected_value, ", got", value)
|
|
|
|
if not description is None:
|
|
|
|
print (description)
|