mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Add numerator/denominator tests to snippets
This commit is contained in:
@@ -52,6 +52,11 @@ with assertRaises(ZeroDivisionError):
|
||||
# real/imag attributes
|
||||
assert (1).real == 1
|
||||
assert (1).imag == 0
|
||||
# numerator/denominator attributes
|
||||
assert (1).numerator == 1
|
||||
assert (1).denominator == 1
|
||||
assert (10).numerator == 10
|
||||
assert (1).denominator == 1
|
||||
|
||||
assert_raises(OverflowError, lambda: 1 << 10 ** 100000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user