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, math.pi**-100, 3.1]:
9 self.assertEquals(float(json.dumps(num)), num)
10 self.assertEquals(json.loads(json.dumps(num)), num)
13 for num in [1, 1L, 1<<32, 1<<64]:
14 self.assertEquals(json.dumps(num), str(num))
15 self.assertEquals(int(json.dumps(num)), num)