mirror of
https://github.com/python/cpython.git
synced 2025-09-04 07:51:13 +00:00
Unparse infinite imaginary literals correctly. Add some more numeric tests.
This commit is contained in:
parent
abe52d749c
commit
cba8c10b5c
2 changed files with 20 additions and 5 deletions
|
@ -123,6 +123,8 @@ class UnparseTestCase(ASTTestCase):
|
|||
|
||||
def test_unary_parens(self):
|
||||
self.check_roundtrip("(-1)**7")
|
||||
self.check_roundtrip("(-1.)**8")
|
||||
self.check_roundtrip("(-1j)**6")
|
||||
self.check_roundtrip("not True or False")
|
||||
self.check_roundtrip("True or not False")
|
||||
|
||||
|
@ -132,6 +134,18 @@ class UnparseTestCase(ASTTestCase):
|
|||
def test_huge_float(self):
|
||||
self.check_roundtrip("1e1000")
|
||||
self.check_roundtrip("-1e1000")
|
||||
self.check_roundtrip("1e1000j")
|
||||
self.check_roundtrip("-1e1000j")
|
||||
|
||||
def test_min_int(self):
|
||||
self.check_roundtrip(str(-2**31))
|
||||
self.check_roundtrip(str(-2**63))
|
||||
|
||||
def test_imaginary_literals(self):
|
||||
self.check_roundtrip("7j")
|
||||
self.check_roundtrip("-7j")
|
||||
self.check_roundtrip("0j")
|
||||
self.check_roundtrip("-0j")
|
||||
|
||||
def test_lambda_parentheses(self):
|
||||
self.check_roundtrip("(lambda: int)()")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue