mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
merge json library with simplejson 2.0.9 (issue 4136)
This commit is contained in:
parent
277859d591
commit
d914e3f861
13 changed files with 2430 additions and 582 deletions
|
@ -5,5 +5,11 @@ import json
|
|||
|
||||
class TestFloat(TestCase):
|
||||
def test_floats(self):
|
||||
for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100]:
|
||||
for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100, 3.1]:
|
||||
self.assertEquals(float(json.dumps(num)), num)
|
||||
self.assertEquals(json.loads(json.dumps(num)), num)
|
||||
|
||||
def test_ints(self):
|
||||
for num in [1, 1L, 1<<32, 1<<64]:
|
||||
self.assertEquals(json.dumps(num), str(num))
|
||||
self.assertEquals(int(json.dumps(num)), num)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue