mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Add testcase for float.__new__
Add testcase for float.__new__
This commit is contained in:
@@ -150,6 +150,8 @@ assert 1.2.__float__() == 1.2
|
||||
assert 1.2.__trunc__() == 1
|
||||
assert int(1.2) == 1
|
||||
assert float(1.2) == 1.2
|
||||
assert float(x=1.2) == 1.2
|
||||
assert float(x='1.2') == 1.2
|
||||
assert math.trunc(1.2) == 1
|
||||
assert_raises(OverflowError, float('inf').__trunc__)
|
||||
assert_raises(ValueError, float('nan').__trunc__)
|
||||
|
||||
Reference in New Issue
Block a user