tests: Split out float test from builtin_round.py.

pull/995/head
Damien George 2014-11-29 14:47:54 +00:00
rodzic 3b603f29ec
commit 7288403b9b
2 zmienionych plików z 13 dodań i 7 usunięć

Wyświetl plik

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

Wyświetl plik

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