diff options
| author | Benjamin Peterson <benjamin@python.org> | 2009-05-02 12:36:44 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2009-05-02 12:36:44 (GMT) |
| commit | c6b607d4a9e4d60fb506034ce67fc89734bb68a7 (patch) | |
| tree | b4f27e81ab25a9dfe6a97433f4d25c263b59f6cc /Lib/json/tests/test_float.py | |
| parent | 7255f18556ae70fc28b563a345577d3ec8f6f0ba (diff) | |
| download | cpython-c6b607d4a9e4d60fb506034ce67fc89734bb68a7.zip cpython-c6b607d4a9e4d60fb506034ce67fc89734bb68a7.tar.gz cpython-c6b607d4a9e4d60fb506034ce67fc89734bb68a7.tar.bz2 | |
port simplejson upgrade from the trunk #4136
json also now works only with unicode strings
Patch by Antoine Pitrou; updated by me
Diffstat (limited to 'Lib/json/tests/test_float.py')
| -rw-r--r-- | Lib/json/tests/test_float.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/json/tests/test_float.py b/Lib/json/tests/test_float.py index 9df6d1ee..2d4aea2 100644 --- a/Lib/json/tests/test_float.py +++ b/Lib/json/tests/test_float.py @@ -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, 1<<32, 1<<64]: + self.assertEquals(json.dumps(num), str(num)) + self.assertEquals(int(json.dumps(num)), num) |
