tests/float: Make output of math function tests more readable.

By explicitly naming the function, its arguments, and result.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-02-16 10:27:10 +11:00
parent 799d888182
commit 177ae2f346
4 changed files with 21 additions and 22 deletions

View File

@@ -44,9 +44,9 @@ functions = [
]
for function_name, function, test_vals in functions:
print(function_name)
for value in test_vals:
try:
print("{:.4g}".format(function(value)))
ans = "{:.4g}".format(function(value))
except ValueError as e:
print(str(e))
ans = str(e)
print("{}({:.4g}) = {}".format(function_name, value, ans))