2
from unittest import TestCase
4
import simplejson as json
6
class TestFloat(TestCase):
8
for num in [1617161771.7650001, math.pi, math.pi**100,
10
self.assertEquals(float(json.dumps(num)), num)
11
self.assertEquals(json.loads(json.dumps(num)), num)
12
self.assertEquals(json.loads(unicode(json.dumps(num))), num)
15
for num in [1, 1L, 1<<32, 1<<64]:
16
self.assertEquals(json.dumps(num), str(num))
17
self.assertEquals(int(json.dumps(num)), num)
18
self.assertEquals(json.loads(json.dumps(num)), num)
19
self.assertEquals(json.loads(unicode(json.dumps(num))), num)