Mercurial > cpython-lru_cache-weakref
diff Lib/json/tests/test_float.py @ 53667:f686aced02a3
port simplejson upgrade from the trunk #4136
json also now works only with unicode strings
Patch by Antoine Pitrou; updated by me
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 02 May 2009 12:36:44 +0000 |
| parents | 9f45979558a9 |
| children | 9fe76c26ea9f |
line wrap: on
line diff
--- a/Lib/json/tests/test_float.py Sat May 02 12:15:39 2009 +0000 +++ b/Lib/json/tests/test_float.py Sat May 02 12:36:44 2009 +0000 @@ -5,5 +5,11 @@ 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, 1<<32, 1<<64]: + self.assertEquals(json.dumps(num), str(num)) + self.assertEquals(int(json.dumps(num)), num)
