tests: Split out float test from builtin_round.py.
This commit is contained in:
parent
3b603f29ec
commit
7288403b9b
@ -1,14 +1,8 @@
|
||||
# test round()
|
||||
# test round() with integral values
|
||||
|
||||
# check basic cases
|
||||
tests = [
|
||||
False, True,
|
||||
0, 1, -1, 10,
|
||||
0.0, 1.0, 0.1, -0.1, 123.4, 123.6, -123.4, -123.6
|
||||
]
|
||||
for t in tests:
|
||||
print(round(t))
|
||||
|
||||
# check .5 cases
|
||||
for i in range(11):
|
||||
print(round((i - 5) / 2))
|
||||
|
12
tests/float/builtin_float_round.py
Normal file
12
tests/float/builtin_float_round.py
Normal file
@ -0,0 +1,12 @@
|
||||
# test round() with floats
|
||||
|
||||
# check basic cases
|
||||
tests = [
|
||||
0.0, 1.0, 0.1, -0.1, 123.4, 123.6, -123.4, -123.6
|
||||
]
|
||||
for t in tests:
|
||||
print(round(t))
|
||||
|
||||
# check .5 cases
|
||||
for i in range(11):
|
||||
print(round((i - 5) / 2))
|
Loading…
x
Reference in New Issue
Block a user