Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(285)

Side by Side Diff: Lib/json/tests/test_float.py

Issue 7311: [issue4136] merge json library with simplejson 2.0.3 Base URL: http://svn.python.org/view/*checkout*/python/trunk/
Patch Set: Created 5 years, 6 months ago , Downloaded from: http://bugs.python.org/file11822/json_issue4136_r66961.diff
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 import math 1 import math
2 from unittest import TestCase 2 from unittest import TestCase
3 3
4 import json 4 import json
5 5
6 class TestFloat(TestCase): 6 class TestFloat(TestCase):
7 def test_floats(self): 7 def test_floats(self):
8 for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100]: 8 for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100]:
9 self.assertEquals(float(json.dumps(num)), num) 9 self.assertEquals(float(json.dumps(num)), num)
10
11 def test_ints(self):
12 for num in [1, 1L, 1<<32, 1<<64]:
13 self.assertEquals(json.dumps(num), str(num))
14 self.assertEquals(int(json.dumps(num)), num)
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1278:e6ce13d99bf5